Skip to content

Commit 6e97aa1

Browse files
committed
Update index.md
1 parent 7d484ca commit 6e97aa1

File tree

1 file changed

+1
-1
lines changed
  • files/en-us/web/css/css_text/whitespace

1 file changed

+1
-1
lines changed

files/en-us/web/css/css_text/whitespace/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ It is a common myth that "HTML ignores whitespace", which is untrue: **HTML pres
2323
> To be clear, we're talking about whitespace _between HTML tags_, which becomes text nodes in the DOM. Any whitespace _inside a tag_ (between the angle brackets but not as part of an attribute value) is just part of the HTML syntax and does not appear in the DOM.
2424
2525
> [!NOTE]
26-
> Due to the magic that is HTML parsing (quote from [DOM spec](https://dom.spec.whatwg.org/#introduction-to-the-dom)), there do exist certain places where whitespace characters could be ignored. For example, whitespace between the `<html>` and `<head>` opening tags or between the `</body>` and `</html>` closing tags is ignored and does not appear in the DOM. In this guide, we're focusing on the whitespace in rendered text content.
26+
> Due to the magic that is HTML parsing (quote from [DOM spec](https://dom.spec.whatwg.org/#introduction-to-the-dom)), there do exist certain places where whitespace characters could be ignored. For example, whitespace between the `<html>` and `<head>` opening tags or between the `</body>` and `</html>` closing tags is ignored and does not appear in the DOM. Also, when parsing the {{HTMLElement("pre")}} element's text content, a single leading newline character gets stripped. We ignore these edge cases.
2727
>
2828
> Furthermore, the HTML parser does [_normalize_ certain whitespaces](https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream): it replaces CR and [CRLF](/en-US/docs/Glossary/CRLF) sequences with a single LF. However, CR characters can also be inserted into the DOM either via [character references](/en-US/docs/Glossary/Character_reference) or JavaScript, so the CSS whitespace processing rules still need to define how to handle them.
2929

0 commit comments

Comments
 (0)