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

Definition + setext underline/thematic break, creates loose empty paragraph #262

Open
wooorm opened this issue Sep 13, 2022 · 3 comments
Open

Comments

@wooorm
Copy link

wooorm commented Sep 13, 2022

I think this is a bug in commonmark.js:

[a]: b
---

[a]: b
===

On the dingus, it yields:

<p></p>
<hr />
<p>===</p>

Rendered here (cmark-gfm + more GH stuff, likely same as just cmark):

<p>---</p>
<p>===</p>

---

===

@jgm
Copy link
Member

jgm commented Nov 30, 2022

One observation: if you change the setext heading line regex to something that will never be matched, the empty p tag disappears. So this is due to some interference with setext heading parsing.

@wooorm
Copy link
Author

wooorm commented Nov 30, 2022

Similar to what you note, I think the area around definitions/setext headings/lists is very hard to think about. One example: wooorm/markdown-rs#22 (comment). I have no idea what should happen in these cases. Which comes first? Which construct has precedence, and what happens if it doesn’t match

@jgm
Copy link
Member

jgm commented Nov 30, 2022

I remember there were some discussions about this -- you could check the tracker (including closed issues) fro commonmark-spec.

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

No branches or pull requests

2 participants