diff --git a/.changeset/gold-rivers-attend.md b/.changeset/gold-rivers-attend.md new file mode 100644 index 00000000..4098768b --- /dev/null +++ b/.changeset/gold-rivers-attend.md @@ -0,0 +1,5 @@ +--- +"htmljs-parser": minor +--- + +Remove boundary newlines and leading indent from concise mode text. 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 ed2d5d30..ba5b451e 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 @@ -4,12 +4,9 @@ │ ││ │╰─ tagArgs.value "notEmpty(data.colors)" │ ││ ╰─ tagArgs "(notEmpty(data.colors))" │ │╰─ tagName "if" - │ ├─ text "\n" ╰─ ╰─ openTagStart 3╭─ │ │ │ ╰─ closeTagEnd(if) │ │ ╰─ closeTagName "if" - │ ├─ text "\n" ╰─ ╰─ closeTagStart "" -4╭─ --- - ╰─ ╰─ text "\n" \ No newline at end of file +4╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt b/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt index 08463b71..a0e2079f 100644 --- a/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt +++ b/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt @@ -1,13 +1,13 @@ 1╭─ -- 2╭─ This is top-level text - ╰─ ╰─ text "\nThis is top-level text\n" + ╰─ ╰─ text "This is top-level text" 3├─ -- 4╭─ p ╰─ ╰─ tagName 5╭─ -- ╰─ ╰─ openTagEnd 6╭─ This is text that spans multiple lines. - ╰─ ╰─ text "\n This is text that spans multiple lines.\n\n " + ╰─ ╰─ text "This is text that spans multiple lines.\n\n" 7├─ 8╭─ You can throw in some HTML markup if you want! │ ││ ││ │ │ ╰─ closeTagEnd(strong) @@ -17,18 +17,20 @@ │ ││ ╰─ openTagEnd │ │╰─ tagName "strong" ╰─ ╰─ openTagStart -9╭─ -- - ╰─ ╰─ text "\n" +9├─ -- 10╭─ p │ ├─ closeTagEnd(p) ╰─ ╰─ tagName 11╭─ ----- ╰─ ╰─ openTagEnd 12╭─ If you really want to you can change the block delimiter for the following - ╰─ ╰─ text "\n If you really want to you can change the block delimiter for the following\n reasons:\n - Avoid accidentally ending a block\n - To improve readability\n" -13├─ reasons: -14├─ - Avoid accidentally ending a block -15├─ - To improve readability + ╰─ ╰─ text "If you really want to you can change the block delimiter for the following\n" +13╭─ reasons: + ╰─ ╰─ text "reasons:\n" +14╭─ - Avoid accidentally ending a block + ╰─ ╰─ text "- Avoid accidentally ending a block\n" +15╭─ - To improve readability + ╰─ ╰─ text "- To improve readability" 16├─ ----- 17╭─ i -- This text will be in italics │ │ │ ╰─ text "This text will be in italics" @@ -47,7 +49,6 @@ │ ├─ closeTagEnd(b) ╰─ ╰─ tagName "app-hello" 22╭─ -- ${data.name} some html - bold - │ │ │ │ │ ││││ │ ││╰─ closeTagEnd(app-hello) │ │ │ │ │ ││││ │ │╰─ closeTagEnd(b) │ │ │ │ │ ││││ │ ╰─ closeTagName │ │ │ │ │ ││││ ╰─ closeTagStart "" @@ -58,4 +59,61 @@ │ │ │ │ ╰─ text " some html - " │ │ │ ╰─ placeholder:escape.value "data.name" │ │ ╰─ placeholder:escape "${data.name}" - ╰─ ╰─ openTagEnd \ No newline at end of file + ╰─ ╰─ openTagEnd +23├─ +24╭─ pre + │ ├─ closeTagEnd(app-hello) + ╰─ ╰─ tagName "pre" +25╭─ -- + ╰─ ╰─ openTagEnd +26╭─ foo + ╰─ ╰─ text "foo" +27├─ -- +28├─ +29╭─ p + │ ├─ closeTagEnd(pre) + ╰─ ╰─ tagName +30╭─ -- + ╰─ ╰─ openTagEnd +31╭─ before + ╰─ ╰─ text "before\n" +32╭─ ${"placeholder"} + │ │ ╰─ placeholder:escape.value "\"placeholder\"" + ╰─ ╰─ placeholder:escape "${\"placeholder\"}" +33╭─ after + │ │ ╰─ text "after" + ╰─ ╰─ text "\n" +34├─ -- +35├─ +36╭─ p + │ ├─ closeTagEnd(p) + ╰─ ╰─ tagName +37╭─ -- + ╰─ ╰─ openTagEnd +38╭─ before + ╰─ ╰─ text "before\n" +39╭─ + │ │ ╰─ comment.value "comment" + ╰─ ╰─ comment "" +40╭─ after + │ │ ╰─ text "after" + ╰─ ╰─ text "\n" +41├─ -- +42├─ +43╭─ p + │ ├─ closeTagEnd(p) + ╰─ ╰─ tagName +44╭─ -- + ╰─ ╰─ openTagEnd +45╭─ before + ╰─ ╰─ text "before\n" +46╭─
+ │ ││ ╰─ openTagEnd:selfClosed "/>" + │ │╰─ tagName "div" + ╰─ ╰─ openTagStart +47╭─ after + │ │ ╰─ text "after" + ╰─ ╰─ text "\n" +48├─ -- +49╭─ + ╰─ ╰─ closeTagEnd(p) \ No newline at end of file diff --git a/src/__tests__/fixtures/complex/input.marko b/src/__tests__/fixtures/complex/input.marko index f6e8b4d6..b9b387a4 100644 --- a/src/__tests__/fixtures/complex/input.marko +++ b/src/__tests__/fixtures/complex/input.marko @@ -19,4 +19,30 @@ b -- This text will be bold -- This is okay too app-hello - -- ${data.name} some html - bold \ No newline at end of file + -- ${data.name} some html - bold + +pre + -- + foo + -- + +p + -- + before + ${"placeholder"} + after + -- + +p + -- + before + + after + -- + +p + -- + before + + after + -- diff --git a/src/__tests__/fixtures/concise-multiline-content/__snapshots__/concise-multiline-content.expected.txt b/src/__tests__/fixtures/concise-multiline-content/__snapshots__/concise-multiline-content.expected.txt index ff3cce84..a2f34d8f 100644 --- a/src/__tests__/fixtures/concise-multiline-content/__snapshots__/concise-multiline-content.expected.txt +++ b/src/__tests__/fixtures/concise-multiline-content/__snapshots__/concise-multiline-content.expected.txt @@ -1,10 +1,10 @@ 1╭─ -- 2╭─ hi - ╰─ ╰─ text "\nhi\n" + ╰─ ╰─ text "hi" 3├─ -- 4├─ 5├─ -- 6╭─ foo - ╰─ ╰─ text "\nfoo\n\n" + ╰─ ╰─ text "foo" 7├─ 8╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt b/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt index d16a7b6b..62958ace 100644 --- a/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt +++ b/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt @@ -20,7 +20,7 @@ 6╭─ --- ╰─ ╰─ openTagEnd 7╭─ var a = 'marko'; - ╰─ ╰─ text "\n var a = 'marko';\n" + ╰─ ╰─ text "var a = 'marko';" 8╭─ --- │ ├─ closeTagEnd(html) │ ├─ closeTagEnd(body) diff --git a/src/__tests__/fixtures/multiline-html-block-empty/__snapshots__/multiline-html-block-empty.expected.txt b/src/__tests__/fixtures/multiline-html-block-empty/__snapshots__/multiline-html-block-empty.expected.txt index b4f6e3cb..22363d14 100644 --- a/src/__tests__/fixtures/multiline-html-block-empty/__snapshots__/multiline-html-block-empty.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-empty/__snapshots__/multiline-html-block-empty.expected.txt @@ -1,3 +1,2 @@ 1╭─ --- -2╭─ --- - ╰─ ╰─ text "\n" \ No newline at end of file +2╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt b/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt index e397d73c..8938a4e6 100644 --- a/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt @@ -3,19 +3,21 @@ 2╭─ -- ╰─ ╰─ openTagEnd 3╭─ Hello World - ╰─ ╰─ text "\n Hello World\n Hello Again\n" -4├─ Hello Again + ╰─ ╰─ text "Hello World\n" +4╭─ Hello Again + ╰─ ╰─ text "Hello Again" 5├─ 6╭─ script -- │ │ ╰─ openTagEnd │ ├─ closeTagEnd(div) ╰─ ╰─ tagName "script" 7╭─ console.log('foo'); - ╰─ ╰─ text "\n console.log('foo');\n alert('bar');\n" -8├─ alert('bar'); + ╰─ ╰─ text "console.log('foo');\n" +8╭─ alert('bar'); + ╰─ ╰─ text "alert('bar');" 9├─ 10╭─ -- ╰─ ╰─ closeTagEnd(script) 11╭─ Multi-line text - ╰─ ╰─ text "\nMulti-line text\nReached EOF" + ╰─ ╰─ text "Multi-line text\nReached EOF" 12╰─ Reached EOF \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt b/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt index b5003489..49cd64dc 100644 --- a/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt @@ -3,5 +3,4 @@ 2╭─ --- ╰─ ╰─ openTagEnd 3╭─ --- - │ │ ╰─ closeTagEnd(p) - ╰─ ╰─ text "\n" \ No newline at end of file + ╰─ ╰─ closeTagEnd(p) \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt b/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt index 172cc19e..4d64060d 100644 --- a/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt @@ -3,15 +3,16 @@ 2╭─ --- ╰─ ╰─ openTagEnd 3╭─ Hello Frank - │ │ ││ ││ │ │ ╰─ closeTagEnd(strong) - │ │ ││ ││ │ ╰─ closeTagName "strong" - │ │ ││ ││ ╰─ closeTagStart "" - │ │ ││ │╰─ text "Frank" - │ │ ││ ╰─ openTagEnd - │ │ │╰─ tagName "strong" - │ │ ╰─ openTagStart - ╰─ ╰─ text "\n Hello " + │ │ ││ ││ │ │ ╰─ closeTagEnd(strong) + │ │ ││ ││ │ ╰─ closeTagName "strong" + │ │ ││ ││ ╰─ closeTagStart "" + │ │ ││ │╰─ text "Frank" + │ │ ││ ╰─ openTagEnd + │ │ │╰─ tagName "strong" + │ │ ╰─ openTagStart + ╰─ ╰─ text "Hello " 4╭─ Line 2 - ╰─ ╰─ text "\n Line 2\n" + │ │ ╰─ text "Line 2" + ╰─ ╰─ text "\n" 5╭─ --- ╰─ ╰─ closeTagEnd(p) \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt b/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt index baa645ec..6a0ddaa1 100644 --- a/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt @@ -2,14 +2,15 @@ │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" 2╭─ Hello World - ╰─ ╰─ text "\n Hello World\n Hello Again\n" -3├─ Hello Again + ╰─ ╰─ text "Hello World\n" +3╭─ Hello Again + ╰─ ╰─ text "Hello Again" 4├─ -- 5╭─ span -- │ │ ╰─ openTagEnd ╰─ ╰─ tagName "span" 6╭─ Goodbye - ╰─ ╰─ text "\n Goodbye\n" + ╰─ ╰─ text "Goodbye" 7╭─ -- │ ├─ closeTagEnd(div) ╰─ ╰─ closeTagEnd(span) \ No newline at end of file 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 8e63b53b..bf19c0ee 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 @@ -7,7 +7,7 @@ │ │ ││ ╰─ openTagEnd │ │ │╰─ tagName "strong" │ │ ╰─ openTagStart - ╰─ ╰─ text "\nHello " + ╰─ ╰─ text "Hello " 3╭─ Line 2 - ╰─ ╰─ text "\nLine 2\n" + ╰─ ╰─ text "Line 2" 4╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-text-block-bad/__snapshots__/multiline-text-block-bad.expected.txt b/src/__tests__/fixtures/multiline-text-block-bad/__snapshots__/multiline-text-block-bad.expected.txt index e27b0450..a84ee497 100644 --- a/src/__tests__/fixtures/multiline-text-block-bad/__snapshots__/multiline-text-block-bad.expected.txt +++ b/src/__tests__/fixtures/multiline-text-block-bad/__snapshots__/multiline-text-block-bad.expected.txt @@ -1,6 +1,6 @@ 1╭─ -- 2╭─ A - ╰─ ╰─ text "\nA\n" + ╰─ ╰─ text 3╭─ --- ╰─ ╰─ error(INVALID_CHARACTER:A concise mode closing block delimiter can only be followed by whitespace.) 4├─ B diff --git a/src/__tests__/fixtures/multiline-text-block-with-hyphens/__snapshots__/multiline-text-block-with-hyphens.expected.txt b/src/__tests__/fixtures/multiline-text-block-with-hyphens/__snapshots__/multiline-text-block-with-hyphens.expected.txt index 854d86a3..38e5e229 100644 --- a/src/__tests__/fixtures/multiline-text-block-with-hyphens/__snapshots__/multiline-text-block-with-hyphens.expected.txt +++ b/src/__tests__/fixtures/multiline-text-block-with-hyphens/__snapshots__/multiline-text-block-with-hyphens.expected.txt @@ -1,5 +1,5 @@ 1╭─ --- 2╭─ - Line 1 - ╰─ ╰─ text "\n- Line 1\n- Line 2\n" + ╰─ ╰─ text "- Line 1\n- Line 2" 3├─ - Line 2 4╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-text-block/__snapshots__/multiline-text-block.expected.txt b/src/__tests__/fixtures/multiline-text-block/__snapshots__/multiline-text-block.expected.txt index 9fb66610..18d96eac 100644 --- a/src/__tests__/fixtures/multiline-text-block/__snapshots__/multiline-text-block.expected.txt +++ b/src/__tests__/fixtures/multiline-text-block/__snapshots__/multiline-text-block.expected.txt @@ -1,5 +1,5 @@ 1╭─ --- 2╭─ Line 1 - ╰─ ╰─ text "\nLine 1\nLine 2\n" + ╰─ ╰─ text "Line 1\nLine 2" 3├─ Line 2 4╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt b/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt index 1470e089..d7c4e3f6 100644 --- a/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt +++ b/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt @@ -3,8 +3,9 @@ 2╭─ --- ╰─ ╰─ openTagEnd 3╭─ This is - ╰─ ╰─ text "\n This is\n multi-line text\n" -4├─ multi-line text + ╰─ ╰─ text "This is\n" +4╭─ multi-line text + ╰─ ╰─ text "multi-line text" 5├─ --- 6╭─ span -- This is body text of span │ │ │ ╰─ text "This is body text of span" 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 56cea64d..b78d932e 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 @@ -5,10 +5,9 @@ │ ││ │ ╰─ attrValue "=\"marko.png\"" │ ││ ╰─ attrName "src" │ │╰─ tagName "img" - │ ├─ text "\n" ╰─ ╰─ openTagStart 3╭─ This is not allowed! - ╰─ ╰─ text "\n This is not allowed!\n" + ╰─ ╰─ text " This is not allowed!\n" 4╭─ │ ├─ error(EXTRA_CLOSING_TAG:The closing "img" tag was not expected) "" ╰─ ╰─ closeTagStart "" diff --git a/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt b/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt index e2006556..99f4ff3a 100644 --- a/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt +++ b/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt @@ -3,8 +3,9 @@ 2╭─ --- ╰─ ╰─ openTagEnd 3╭─ This is text - ╰─ ╰─ text "\n This is text\n within the block\n" -4├─ within the block + ╰─ ╰─ text "This is text\n" +4╭─ within the block + ╰─ ╰─ text "within the block" 5├─ --- 6╭─ -- This should be okay too ╰─ ╰─ text "This should be okay too" diff --git a/src/__tests__/fixtures/scriptlet-block-html/__snapshots__/scriptlet-block-html.expected.txt b/src/__tests__/fixtures/scriptlet-block-html/__snapshots__/scriptlet-block-html.expected.txt index 91a25c1f..ad97be60 100644 --- a/src/__tests__/fixtures/scriptlet-block-html/__snapshots__/scriptlet-block-html.expected.txt +++ b/src/__tests__/fixtures/scriptlet-block-html/__snapshots__/scriptlet-block-html.expected.txt @@ -1,10 +1,8 @@ 1╭─ --- 2╭─ $ { - │ ├─ text "\n" ╰─ ╰─ scriptlet:block "$ {\n var foo = 123;\n var bar = 456;\n}" 3╭─ var foo = 123; ╰─ ╰─ scriptlet:block.value "\n var foo = 123;\n var bar = 456;\n" 4├─ var bar = 456; 5├─ } -6╭─ --- - ╰─ ╰─ text "\n" \ No newline at end of file +6╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/scriptlet-line-html/__snapshots__/scriptlet-line-html.expected.txt b/src/__tests__/fixtures/scriptlet-line-html/__snapshots__/scriptlet-line-html.expected.txt index dd9267bc..cc90cb37 100644 --- a/src/__tests__/fixtures/scriptlet-line-html/__snapshots__/scriptlet-line-html.expected.txt +++ b/src/__tests__/fixtures/scriptlet-line-html/__snapshots__/scriptlet-line-html.expected.txt @@ -1,7 +1,5 @@ 1╭─ --- 2╭─ $ var foo = 123; │ │ ╰─ scriptlet.value "var foo = 123;" - │ ├─ text "\n" ╰─ ╰─ scriptlet "$ var foo = 123;" -3╭─ --- - ╰─ ╰─ text "\n" \ No newline at end of file +3╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/scriptlet-line-no-middle-html/__snapshots__/scriptlet-line-no-middle-html.expected.txt b/src/__tests__/fixtures/scriptlet-line-no-middle-html/__snapshots__/scriptlet-line-no-middle-html.expected.txt index 7a43d8d8..9de0a6ff 100644 --- a/src/__tests__/fixtures/scriptlet-line-no-middle-html/__snapshots__/scriptlet-line-no-middle-html.expected.txt +++ b/src/__tests__/fixtures/scriptlet-line-no-middle-html/__snapshots__/scriptlet-line-no-middle-html.expected.txt @@ -1,4 +1,4 @@ 1╭─ --- 2╭─ hello $ var foo = 123; - ╰─ ╰─ text "\nhello $ var foo = 123;\n" + ╰─ ╰─ text "hello $ var foo = 123;" 3╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/simple-text-delimited/__snapshots__/simple-text-delimited.expected.txt b/src/__tests__/fixtures/simple-text-delimited/__snapshots__/simple-text-delimited.expected.txt index 3a420756..09e75039 100644 --- a/src/__tests__/fixtures/simple-text-delimited/__snapshots__/simple-text-delimited.expected.txt +++ b/src/__tests__/fixtures/simple-text-delimited/__snapshots__/simple-text-delimited.expected.txt @@ -1,5 +1,5 @@ 1╭─ --- 2╭─ test - ╰─ ╰─ text "\ntest\n" + ╰─ ╰─ text "test" 3├─ --- 4╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/tag-var-before-concise-text/__snapshots__/tag-var-before-concise-text.expected.txt b/src/__tests__/fixtures/tag-var-before-concise-text/__snapshots__/tag-var-before-concise-text.expected.txt index 360f1fd3..eb2d1ec8 100644 --- a/src/__tests__/fixtures/tag-var-before-concise-text/__snapshots__/tag-var-before-concise-text.expected.txt +++ b/src/__tests__/fixtures/tag-var-before-concise-text/__snapshots__/tag-var-before-concise-text.expected.txt @@ -4,8 +4,10 @@ │ │ ╰─ tagVar "/style" ╰─ ╰─ tagName "style" 2╭─ header { - ╰─ ╰─ text "\n header {\n color: green\n }\n" -3├─ color: green -4├─ } + ╰─ ╰─ text "header {\n" +3╭─ color: green + ╰─ ╰─ text " color: green\n" +4╭─ } + ╰─ ╰─ text 5╭─ ╰─ ╰─ closeTagEnd(style) \ No newline at end of file diff --git a/src/__tests__/fixtures/text-parse-mode-delimited-block/__snapshots__/text-parse-mode-delimited-block.expected.txt b/src/__tests__/fixtures/text-parse-mode-delimited-block/__snapshots__/text-parse-mode-delimited-block.expected.txt index a0e38ccb..3f75c077 100644 --- a/src/__tests__/fixtures/text-parse-mode-delimited-block/__snapshots__/text-parse-mode-delimited-block.expected.txt +++ b/src/__tests__/fixtures/text-parse-mode-delimited-block/__snapshots__/text-parse-mode-delimited-block.expected.txt @@ -6,7 +6,7 @@ 3╭─ --- ╰─ ╰─ openTagEnd 4╭─ Test - ╰─ ╰─ text "\n Test\n " + ╰─ ╰─ text "Test\n" 5╭─ Hello World │ ││││ │ │╰─ closeTagEnd(b) │ ││││ │ ╰─ closeTagName @@ -16,6 +16,5 @@ │ │╰─ tagName ╰─ ╰─ openTagStart 6╭─ --- - │ │ ├─ closeTagEnd(div) - │ │ ╰─ closeTagEnd(span) - ╰─ ╰─ text "\n" \ No newline at end of file + │ ├─ closeTagEnd(div) + ╰─ ╰─ closeTagEnd(span) \ No newline at end of file diff --git a/src/__tests__/fixtures/whitespace-preservation/__snapshots__/whitespace-preservation.expected.txt b/src/__tests__/fixtures/whitespace-preservation/__snapshots__/whitespace-preservation.expected.txt index b01d549b..ce524e82 100644 --- a/src/__tests__/fixtures/whitespace-preservation/__snapshots__/whitespace-preservation.expected.txt +++ b/src/__tests__/fixtures/whitespace-preservation/__snapshots__/whitespace-preservation.expected.txt @@ -32,7 +32,7 @@ │ ├─ closeTagEnd(span) ╰─ ╰─ tagName "span" 11╭─ hi - ╰─ ╰─ text "\n hi\n" + ╰─ ╰─ text "hi" 12├─ 13╭─ span.e -- │ │ ││ ╰─ openTagEnd @@ -41,8 +41,9 @@ │ ├─ closeTagEnd(span) ╰─ ╰─ tagName "span" 14╭─ hi - ╰─ ╰─ text "\n hi\n you\n" -15├─ you + ╰─ ╰─ text "hi\n" +15╭─ you + ╰─ ╰─ text "you" 16├─ 17╭─ span.f │ │ │╰─ tagShorthandClass.quasis[0] @@ -52,7 +53,7 @@ 18╭─ -- ╰─ ╰─ openTagEnd 19╭─ hi - ╰─ ╰─ text "\n hi\n" + ╰─ ╰─ text "hi" 20├─ -- 21├─ 22╭─ span.g @@ -63,8 +64,9 @@ 23╭─ -- ╰─ ╰─ openTagEnd 24╭─ hi - ╰─ ╰─ text "\n hi\n you\n" -25├─ you + ╰─ ╰─ text "hi\n" +25╭─ you + ╰─ ╰─ text "you" 26├─ -- 27├─ 28╭─