Skip to content

feat: support comments between concise mode line attributes#225

Merged
DylanPiercey merged 1 commit into
mainfrom
claude/htmljs-parser-203-ppn9y0
Jun 26, 2026
Merged

feat: support comments between concise mode line attributes#225
DylanPiercey merged 1 commit into
mainfrom
claude/htmljs-parser-203-ppn9y0

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

Fixes #203.

A comment line between comma-prefixed concise line attributes previously terminated the open tag, so the following line was misparsed as a new tag:

div
  ,foo=bar
  // comment
  ,bar=baz

The open tag now scans over // and /*...*/ comment lines between line attributes. The comments are skipped (not emitted), consistent with comments elsewhere in an open tag, and no longer end the tag. A trailing comment that isn't followed by another line attribute is still treated as content, preserving existing behavior.

Includes test fixtures and a changeset.


Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6a6e515

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

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2bb87e44-b72b-4bd2-9dd5-2aba671c10b2

📥 Commits

Reviewing files that changed from the base of the PR and between aaeb3fd and 6a6e515.

⛔ Files ignored due to path filters (2)
  • src/__tests__/fixtures/attr-comma-multiline-comment-trailing/__snapshots__/attr-comma-multiline-comment-trailing.expected.txt is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/attr-comma-multiline-comments/__snapshots__/attr-comma-multiline-comments.expected.txt is excluded by !**/__snapshots__/** and included by **
📒 Files selected for processing (4)
  • .changeset/quick-comments-attrs.md
  • src/__tests__/fixtures/attr-comma-multiline-comment-trailing/input.marko
  • src/__tests__/fixtures/attr-comma-multiline-comments/input.marko
  • src/states/OPEN_TAG.ts

Walkthrough

The parser’s concise-mode open-tag handling now scans past whitespace and line or block comments after a newline before checking for a comma. If no comma is found, it exits the open-tag state. The PR also adds fixtures covering multiline comma-separated attributes with inline, block, and trailing comments, plus a changeset entry noting the new support.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/htmljs-parser-203-ppn9y0

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (aaeb3fd) to head (6a6e515).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #225   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          34       34           
  Lines        4233     4261   +28     
  Branches      782      792   +10     
=======================================
+ Hits         4231     4259   +28     
  Misses          2        2           

☔ 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.

Allow `//` and `/*...*/` comment lines between comma-prefixed line
attributes in concise mode. The comments are scanned over (not emitted)
and no longer terminate the open tag.

Fixes #203
@DylanPiercey DylanPiercey force-pushed the claude/htmljs-parser-203-ppn9y0 branch from 77ac694 to 6a6e515 Compare June 26, 2026 15:34
@DylanPiercey DylanPiercey merged commit 4d28e16 into main Jun 26, 2026
8 checks passed
@DylanPiercey DylanPiercey deleted the claude/htmljs-parser-203-ppn9y0 branch June 26, 2026 15:34
@github-actions github-actions Bot mentioned this pull request Jun 26, 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.

Support comments between concise mode line attributes

1 participant