Skip to content

Commit 197a9e8

Browse files
gangsthubchrisvfritz
authored andcommitted
Edit multiline text style to trim the white space (vuejs#929)
If we change it form `pre` to `pre-line` we get a nicer trimmed text on each line without the need of modifiers. Definition on both can be found in [the spec](https://www.w3.org/TR/css-text-3/#white-space-property) as follows: ``` ‘pre’ This value prevents user agents from collapsing sequences of white space. Segment breaks such as line feeds and carriage returns are preserved as forced line breaks. Lines only break at forced line breaks; content that does not fit within the block container overflows it. ‘pre-line’ Like ‘normal’, this value collapses consecutive spaces and allows wrapping, but preserves segment breaks in the source as forced line breaks. ``` Both have the same browser support.
1 parent 4900abf commit 197a9e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/v2/guide/forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ new Vue({
3838

3939
``` html
4040
<span>Multiline message is:</span>
41-
<p style="white-space: pre">{{ message }}</p>
41+
<p style="white-space: pre-line">{{ message }}</p>
4242
<br>
4343
<textarea v-model="message" placeholder="add multiple lines"></textarea>
4444
```

0 commit comments

Comments
 (0)