Skip to content

feat: concise line starts: ignore ;, read [ and - names, and name tags ended before a name - #261

Merged
DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-typescript-7-janf0a-concise-comma-feedback
Nov 2, 2026
Merged

DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-typescript-7-janf0a-concise-comma-feedback

Conversation

@DylanPiercey

@DylanPiercey DylanPiercey commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes and additions for what a concise line can start with:

  • An open tag could end before its name was read, as with a line of just , (eg while typing) or <,>. The parser then emitted onOpenTagEnd without onOpenTagName, which crashed the Marko compiler and the language tools' parser (failing the whole TypeScript content mapper transform for the template), and <,> crashed the parser itself. Such a tag is now named empty where its open tag ends, as one starting with |, . or # already is.
  • A line starting with ; is now ignored rather than opening a nameless tag. As after a tag's ;, only comments may follow it.
  • A line starting with [ reads the attribute group after an empty name, rather than reading the group's first attribute as the tag name ([a=1] was an a tag with an attribute named "").
  • A line starting with - and a word character (eg -if) opens a tag whose name starts with -, as <-if> already does in HTML mode, for an upcoming feature. - text and a - line within a text-only tag are still errors.

Input that already parsed correctly emits the same events as before. After release, the htmljs-parser floor in the compiler and prettier-plugin-marko should be raised.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 32715b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
htmljs-parser Minor

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

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.89%. Comparing base (3b59c74) to head (32715b5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #261   +/-   ##
=======================================
  Coverage   99.89%   99.89%           
=======================================
  Files          35       35           
  Lines        4711     4753   +42     
  Branches      912      920    +8     
=======================================
+ Hits         4706     4748   +42     
  Misses          4        4           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DylanPiercey DylanPiercey changed the title fix: name an open tag that ends before its name feat: concise line starts: ignore ;, read [ and - names, and name tags ended before a name Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c65d5ee-f518-4e37-aebf-956f3eb33a83
Commits

Reviewing files that changed from the base of the PR and between b40efd0 and 32715b5.

Files ignored due to path filters: 5
  • src/__tests__/fixtures/concise-attr-group-without-name/__snapshots__/concise-attr-group-without-name.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/concise-semicolon-line/__snapshots__/concise-semicolon-line.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/concise-tag-name-hyphen-in-text/__snapshots__/concise-tag-name-hyphen-in-text.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/concise-tag-name-hyphen/__snapshots__/concise-tag-name-hyphen.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/open-tag-ended-before-name/__snapshots__/open-tag-ended-before-name.expected.txt is excluded by !**/__snapshots__/** and included by **
Files selected for processing: 11
  • .changeset/concise-attr-group-without-name.md
  • .changeset/concise-semicolon-line.md
  • .changeset/concise-tag-name-hyphen.md
  • .changeset/open-tag-ended-before-name.md
  • src/__tests__/fixtures/concise-attr-group-without-name/input.marko
  • src/__tests__/fixtures/concise-semicolon-line/input.marko
  • src/__tests__/fixtures/concise-tag-name-hyphen-in-text/input.marko
  • src/__tests__/fixtures/concise-tag-name-hyphen/input.marko
  • src/__tests__/fixtures/open-tag-ended-before-name/input.marko
  • src/states/CONCISE_HTML_CONTENT.ts
  • src/states/OPEN_TAG.ts

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b0ebb1e2-e582-4793-9a66-eec5818893c2
Commits

Reviewing files that changed from the base of the PR and between 75c0578 and b40efd0.

Files ignored due to path filters: 5
  • src/__tests__/fixtures/concise-attr-group-without-name/__snapshots__/concise-attr-group-without-name.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/concise-semicolon-line/__snapshots__/concise-semicolon-line.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/concise-tag-name-hyphen-in-text/__snapshots__/concise-tag-name-hyphen-in-text.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/concise-tag-name-hyphen/__snapshots__/concise-tag-name-hyphen.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/open-tag-ended-before-name/__snapshots__/open-tag-ended-before-name.expected.txt is excluded by !**/__snapshots__/** and included by **
Files selected for processing: 11
  • .changeset/concise-attr-group-without-name.md
  • .changeset/concise-semicolon-line.md
  • .changeset/concise-tag-name-hyphen.md
  • .changeset/open-tag-ended-before-name.md
  • src/__tests__/fixtures/concise-attr-group-without-name/input.marko
  • src/__tests__/fixtures/concise-semicolon-line/input.marko
  • src/__tests__/fixtures/concise-tag-name-hyphen-in-text/input.marko
  • src/__tests__/fixtures/concise-tag-name-hyphen/input.marko
  • src/__tests__/fixtures/open-tag-ended-before-name/input.marko
  • src/states/CONCISE_HTML_CONTENT.ts
  • src/states/OPEN_TAG.ts
Files skipped from review as they are similar to previous changes: 1
  • .changeset/open-tag-ended-before-name.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The parser now handles open tags that end before their name by creating an empty tag-name range and calling onOpenTagName before onOpenTagEnd. Concise-line parsing also handles leading semicolons, hyphen-prefixed tag names, and leading attribute groups. New fixtures cover these cases, and changesets describe the parser updates.

Severity of issue fixed: Medium

Merge Risk: Minimal · previous review b40ef

The concise-line changes have no identified new merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly summarizes the main parser changes for concise line starts and unnamed tags. It is specific and related to the changeset, although it includes several details.
Description check Passed The description directly explains each parser change, affected inputs, preserved behavior, and follow-up release work. It is fully related to the changeset.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (9 skipped: 9 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@DylanPiercey
DylanPiercey force-pushed the dpiercey-ws-typescript-7-janf0a-concise-comma-feedback branch from b40efd0 to 23693db Compare November 2, 2026 21:50
…me tags ended before a name

- An open tag that ends before its name (eg a line of just `,`, or `<,>`)
  is named empty, so a tag never ends without `onOpenTagName`.
- A concise line starting with `;` is ignored; only comments may follow.
- A concise line starting with `[` reads the group after an empty name.
- A concise line starting with `-` and a word character (eg `-if`) opens
  a tag whose name starts with `-`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DylanPiercey
DylanPiercey force-pushed the dpiercey-ws-typescript-7-janf0a-concise-comma-feedback branch from 23693db to 32715b5 Compare November 2, 2026 22:07
@DylanPiercey
DylanPiercey merged commit 1773778 into main Nov 2, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant