Newlines lost in .innerHTML serialization of <pre> when first character is a newline

Issue #7127291 • Assigned to Travis L.

Details

Created
Apr 6, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
  • Chrome
  • Safari
  • Firefox
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

The HTML spec says

If current node is a pre, textarea, or listing element, and the first child node of the element, if any, is a Text node whose character data has as its first character a U+000A LINE FEED (LF) character, then append a U+000A LINE FEED (LF) character.
https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
This is because otherwise it doesn’t round-trip correctly if the data starts with a LF.
See https://github.com/whatwg/html/issues/944

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Travis L.”

      Changed Assigned To from “Travis L.” to “Ibrahim O.”

      Changed Assigned To to “Travis L.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in