diff --git a/.changeset/metal-bobcats-bathe.md b/.changeset/metal-bobcats-bathe.md new file mode 100644 index 00000000..06ef0f93 --- /dev/null +++ b/.changeset/metal-bobcats-bathe.md @@ -0,0 +1,5 @@ +--- +"htmljs-parser": patch +--- + +Fix regression which incorrectly removed some whitespace in concise mode html blocks. diff --git a/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt b/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt index ba5b451e..a6c4384a 100644 --- a/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt +++ b/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt @@ -8,5 +8,6 @@ 3╭─ │ │ │ ╰─ closeTagEnd(if) │ │ ╰─ closeTagName "if" + │ ├─ text "\n" ╰─ ╰─ closeTagStart " + │ ││ ╰─ openTagEnd + │ │╰─ tagName "div" + ╰─ ╰─ openTagStart +4╭─ 2 + ╰─ ╰─ text "\n 2\n" +5╭─ + │ │ │ ╰─ closeTagEnd(div) + │ │ ╰─ closeTagName "div" + ╰─ ╰─ closeTagStart " + │ ││ ╰─ openTagEnd + │ │╰─ tagName "div" + ╰─ ╰─ openTagStart +8╭─ 4 + ╰─ ╰─ text "\n 4\n" +9╭─ + │ │ │ ╰─ closeTagEnd(div) + │ │ ╰─ closeTagName "div" + ╰─ ╰─ closeTagStart " + 2 + +3 +
+ 4 +
+5 +--- diff --git a/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt b/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt index bf19c0ee..62701200 100644 --- a/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt @@ -9,5 +9,5 @@ │ │ ╰─ openTagStart ╰─ ╰─ text "Hello " 3╭─ Line 2 - ╰─ ╰─ text "Line 2" + ╰─ ╰─ text "\nLine 2" 4╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt b/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt index b78d932e..d6dc0d95 100644 --- a/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt +++ b/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt @@ -7,7 +7,7 @@ │ │╰─ tagName "img" ╰─ ╰─ openTagStart 3╭─ This is not allowed! - ╰─ ╰─ text " This is not allowed!\n" + ╰─ ╰─ text "\n This is not allowed!\n" 4╭─ │ ├─ error(EXTRA_CLOSING_TAG:The closing "img" tag was not expected) "" ╰─ ╰─ closeTagStart "