fix: trailing whitespace concise blocks#218
Conversation
🦋 Changeset detectedLatest commit: c63e244 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis pull request fixes a bug in the htmljs-parser where trailing literal whitespace in concise blocks was incorrectly skipped. The fix introduces a new utility function 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/__tests__/fixtures/concise-line-whitespace-ending/input.marko (1)
1-1: Consider adding a CRLF variant of this fixture.Optional, but useful to lock behavior for Windows-style line endings (
\r\n) alongside the current EOF-trailing-space case.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/__tests__/fixtures/concise-line-whitespace-ending/input.marko` at line 1, Add a Windows CRLF variant of the trailing-space fixture: create a new fixture file containing the exact same text "-- ${value} " but with a CRLF ("\r\n") line ending (use the same basename with a .crlf or .windows suffix so it sits alongside the existing fixture), ensuring the test harness will pick up both the original EOF-trailing-space case and this Windows-style line-ending case.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/__tests__/fixtures/concise-line-whitespace-ending/input.marko`:
- Line 1: Add a Windows CRLF variant of the trailing-space fixture: create a new
fixture file containing the exact same text "-- ${value} " but with a CRLF
("\r\n") line ending (use the same basename with a .crlf or .windows suffix so
it sits alongside the existing fixture), ensuring the test harness will pick up
both the original EOF-trailing-space case and this Windows-style line-ending
case.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
src/__tests__/fixtures/concise-block-whitespace-leading/__snapshots__/concise-block-whitespace-leading.expected.txtis excluded by!**/__snapshots__/**and included by**src/__tests__/fixtures/concise-line-whitespace-ending/__snapshots__/concise-line-whitespace-ending.expected.txtis excluded by!**/__snapshots__/**and included by**
📒 Files selected for processing (5)
.changeset/tricky-aliens-cut.mdsrc/__tests__/fixtures/concise-block-whitespace-leading/input.markosrc/__tests__/fixtures/concise-line-whitespace-ending/input.markosrc/states/BEGIN_DELIMITED_HTML_BLOCK.tssrc/util/util.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #218 +/- ##
==========================================
+ Coverage 92.00% 92.02% +0.02%
==========================================
Files 28 28
Lines 1450 1454 +4
Branches 328 329 +1
==========================================
+ Hits 1334 1338 +4
Misses 54 54
Partials 62 62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes a regression from #199 which incorrectly removed non newline whitespaces at the end of concise text blocks.
The " " after
Hellowas being incorrectly removed.