Vue: Line breaks in textarea are excessively removed.

Created on 10 Jun 2020  路  2Comments  路  Source: vuejs/vue

Version

2.6.11

Reproduction link

https://codepen.io/kubotafumiya/pen/qBOwEOV

Steps to reproduce

  1. Set the el option to an element that contains a textarea (or pre) with a newline at the beginning, and create a Vue instance.
<div id="app">
<textarea>


Three line breaks are ignored.
</textarea>
</div>
new Vue({
  el: '#app',
});

What is expected?

The line breaks are removed.

What is actually happening?

Line breaks are not deleted.


https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions

I think it's okay for a single line break to be ignored according to this specification.

bug

Most helpful comment

I found the reason. Can i take this issue.

All 2 comments

I found the reason. Can i take this issue.

@wonhyoung05 Yes, I couldn't find an existing issue or PR for this problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seemsindie picture seemsindie  路  3Comments

bdedardel picture bdedardel  路  3Comments

julianxhokaxhiu picture julianxhokaxhiu  路  3Comments

bfis picture bfis  路  3Comments

6pm picture 6pm  路  3Comments