Repository navigation
fix(parse): read a stray </br> as a line break - #538
Conversation
Architecture Data flow 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
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
|
No actionable comments were generated in the recent review.
|
| 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
- Parsing errors and content lost when saving Markdown #525: Item 11 reports that a stray
</br>disappears instead of producing a line break. This change addresses that behavior.
Possibly related PRs
- comarkdown/comark#530: It changes the same tree-construction behavior for unmatched
</br>tags. - comarkdown/comark#535: It changes how
brnodes are serialized, including nodes created by this change.
Merge Risk: 
Minimal · up to 54376
-
The parser change is narrowly scoped and has no established regression risk.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
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 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.
|
@danielroe is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
comark
@comark/angular
@comark/ansi
@comark/html
@comark/nuxt
@comark/react
@comark/svelte
@comark/vue
commit: |
Merging this PR will not alter performance1 warning
Comparing |
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.mdhas:the stray
</br>is dropped, so thestrongis followed directly byEnable. 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
bras<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.Summary by CodeRabbit
</br>tags now render as line breaks, both inline with text and as standalone elements.