Skip to content

fix(parse): read a stray </br> as a line break - #538

Merged
farnabaz merged 2 commits into
comarkdown:mainfrom
danielroe:fix-5
Nov 2, 2026
Merged

farnabaz merged 2 commits into
comarkdown:mainfrom
danielroe:fix-5

Conversation

@danielroe

@danielroe danielroe commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What

Note

context: this is one of a few fixes from round-tripping the Nuxt docs through parseMarkdown -> renderMarkdown.

docs/4.api/3.utils/define-page-meta.md has:

**Experimental feature, only available when [enabled in your nuxt.config file](...)**</br>
Enable/disable View Transitions for the current page.

the stray </br> is dropped, so the strong is followed directly by Enable. rendered back that's ...file)**Enable, which is no longer a closing **, and the re-parse shows literal asterisks.

now, to be fair this is a typo.... but browsers do parse an end tag named br as <br> (a special case in the HTML spec), so this does the same for a </br> with no opener. other stray closing tags are still ignored.


Play the walkthrough    Follow each request

Summary by CodeRabbit

  • Bug Fixes
    • Stray </br> tags now render as line breaks, both inline with text and as standalone elements.

@danielroe
danielroe requested a review from farnabaz as a code owner November 2, 2026 09:17
@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
  • Redraw · drawn at b4e2ca4, the branch has moved on

Architecture

Architecture diagram for comarkdown/comark at b4e2ca4

Play the walkthrough


Data flow

Data flow diagram for comarkdown/comark at b4e2ca4

Follow each request


Tip

The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a65f6974-5cb8-4ab6-bdb3-bf13dbabdc0b
Commits

Reviewing files that changed from the base of the PR and between 1f734a5 and 54376e2.

Files selected for processing: 2
  • packages/comark/src/internal/parse/tree.ts
  • packages/comark/test/html-block.test.ts

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

Walkthrough

When the parser encounters an unmatched </br>, it now creates a br node. Tests cover inline and block contexts, including parsing with Markdown disabled.

Changes: Stray br tag parsing

Layer / File(s) Summary
Convert unmatched br tags and test contexts
packages/comark/src/internal/parse/tree.ts, packages/comark/test/html-block.test.ts
An unmatched </br> now produces a br node. Tests cover inline placement, block placement, and parsing with Markdown disabled.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

Merge Risk: Minimal · up to 54376

The parser change is narrowly scoped and has no established regression risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: a stray closing </br> tag is now parsed as a line break. The raw summary confirms that html_inline emits a <br> node for an unmatched </br>, and the added tests…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. 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: Title check

Explanation

The title states the main change: a stray closing &lt;/br&gt; tag is now parsed as a line break. The raw summary confirms that html_inline emits a &lt;br&gt; node for an unmatched &lt;/br&gt;, and the added tests cover inline and block cases. The PR objectives describe the same goal, so the title matches the changeset and names the primary behavior change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. 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 0 functions across 2 files.

Finishing Touches
Generate unit tests (beta)
  • 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

@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

@danielroe is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark

npm i https://pkg.pr.new/comark@538

@comark/angular

npm i https://pkg.pr.new/@comark/angular@538

@comark/ansi

npm i https://pkg.pr.new/@comark/ansi@538

@comark/html

npm i https://pkg.pr.new/@comark/html@538

@comark/nuxt

npm i https://pkg.pr.new/@comark/nuxt@538

@comark/react

npm i https://pkg.pr.new/@comark/react@538

@comark/svelte

npm i https://pkg.pr.new/@comark/svelte@538

@comark/vue

npm i https://pkg.pr.new/@comark/vue@538

commit: 54376e2

@codspeed

codspeed Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 5 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 41 untouched benchmarks


Comparing danielroe:fix-5 (54376e2) with main (1f734a5)

Open in CodSpeed

@farnabaz farnabaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@farnabaz
farnabaz merged commit 41409df into comarkdown:main Nov 2, 2026
7 of 16 checks passed
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.

2 participants