fix(breaks): preserve newlines in whitespace-sensitive elements - #312
Merged
farnabaz merged 4 commits intoJul 30, 2026
Merged
Conversation
|
@Snack-X 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: |
Collaborator
|
@Snack-X Thanks for the PR. |
The breaks plugin converted every newline in string children to a `br` node, including inside code and math blocks where newlines must stay literal. Skip visiting whitespace-sensitive tags (`pre`, `code`, `math`, `script`, `style`, `textarea`) so their content is untouched. Fixes comarkdown#311 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Snack-X
force-pushed
the
fix/breaks-whitespace-sensitive-tags
branch
from
July 30, 2026 13:06
494df50 to
7d86564
Compare
Contributor
Author
|
@farnabaz I think it is signed now, judging by the "Verified" badge on the commit |
farnabaz
approved these changes
Jul 30, 2026
This was referenced Aug 3, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Resolves: #311
❓ Type of change
📚 Description
In
breaksplugin, ignored list of tags is added while walking through the child nodes.In addition to
<pre>and<code>which are related to the linked issue,<math>,<script>,<style>, and<textarea>are also in the ignorelist.📝 Checklist
pnpm verifyand it passes.