Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix setext heading interupts #3210

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Mar 4, 2024

Marked version: 12.0.0

Description

setext spec

Setext heading should not follow list item, code block, block quote, ATX heading, or HTML block.

Contributor

  • Test(s) exist to ensure functionality and minimize regression

Committer

In most cases, this should be a different person than the contributor.

Copy link

vercel bot commented Mar 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2024 3:02am

<p>fenced code block</p>
<pre><code>=
</code></pre>
<blockquote><h1>blockquote</h1>
Copy link
Member

Choose a reason for hiding this comment

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

The <h1> here doesn't match what I'm seeing in Commonmark. Should be <p> instead.

https://spec.commonmark.org/dingus/

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm ya it looks like common mark treats blockquote differently based on if it has a > at the beginning of the line.

demo 1
demo 2

The spec says the block quote will continue without lines starting with > only if the content is paragraph continuation text. And it gives Example 234 as an example of not continuing the block quote.

In this case the = would not be paragraph continuation text since it indicates a setext heading without the content above being a blockquote.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like commonmark/commonmark-spec#539 seems to say it is paragraph continuation text simply because common mark says so.

This is one of those rules where the common mark spec states how commonmark works, not how markdown should work. 😕

This is how marked works currently anyway so it isn't a regression.

I will create an L2 bug for this but I don't think it should block this PR.

@UziTech UziTech merged commit d848445 into markedjs:master Mar 6, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 6, 2024
## [12.0.1](v12.0.0...v12.0.1) (2024-03-06)

### Bug Fixes

* fix setext heading interupts ([#3210](#3210)) ([d848445](d848445))
@UziTech UziTech deleted the setext-no-blankline branch June 25, 2024 04:38
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.

Equals sign in code block breaks it
5 participants