Skip to content

Line breaks in textarea are excessively removed. #11446

Open
@KUBOTAfumiya

Description

@KUBOTAfumiya

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions