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 ""
4╰─ ---
\ No newline at end of file
diff --git a/src/__tests__/fixtures/mixed-block-root/__snapshots__/mixed-block-root.expected.txt b/src/__tests__/fixtures/mixed-block-root/__snapshots__/mixed-block-root.expected.txt
new file mode 100644
index 00000000..e5bb4fb6
--- /dev/null
+++ b/src/__tests__/fixtures/mixed-block-root/__snapshots__/mixed-block-root.expected.txt
@@ -0,0 +1,29 @@
+1╭─ ---
+2╭─ 1
+ ╰─ ╰─ text "1\n"
+3╭─
+ │ ││ ╰─ openTagEnd
+ │ │╰─ tagName "div"
+ ╰─ ╰─ openTagStart
+4╭─ 2
+ ╰─ ╰─ text "\n 2\n"
+5╭─
+ │ │ │ ╰─ closeTagEnd(div)
+ │ │ ╰─ closeTagName "div"
+ ╰─ ╰─ closeTagStart ""
+6╭─ 3
+ ╰─ ╰─ text "\n3\n"
+7╭─
+ │ ││ ╰─ openTagEnd
+ │ │╰─ tagName "div"
+ ╰─ ╰─ openTagStart
+8╭─ 4
+ ╰─ ╰─ text "\n 4\n"
+9╭─
+ │ │ │ ╰─ closeTagEnd(div)
+ │ │ ╰─ closeTagName "div"
+ ╰─ ╰─ closeTagStart ""
+10╭─ 5
+ ╰─ ╰─ text "\n5"
+11├─ ---
+12╰─
\ No newline at end of file
diff --git a/src/__tests__/fixtures/mixed-block-root/input.marko b/src/__tests__/fixtures/mixed-block-root/input.marko
new file mode 100644
index 00000000..7479a242
--- /dev/null
+++ b/src/__tests__/fixtures/mixed-block-root/input.marko
@@ -0,0 +1,11 @@
+---
+1
+
+ 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 ""
diff --git a/src/states/BEGIN_DELIMITED_HTML_BLOCK.ts b/src/states/BEGIN_DELIMITED_HTML_BLOCK.ts
index 5ef8bd2c..ac589b6f 100644
--- a/src/states/BEGIN_DELIMITED_HTML_BLOCK.ts
+++ b/src/states/BEGIN_DELIMITED_HTML_BLOCK.ts
@@ -137,5 +137,7 @@ function handleDelimitedBlockEOL(
parser.pos = pos;
parser.exitState();
parser.exitState();
+ } else if (!first && parser.pos + newLineLength !== parser.maxPos) {
+ parser.startText();
}
}