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

remark-parse: ( in strong block will broke the block #1207

Closed
4 tasks done
ZxBing0066 opened this issue Aug 13, 2023 · 7 comments
Closed
4 tasks done

remark-parse: ( in strong block will broke the block #1207

ZxBing0066 opened this issue Aug 13, 2023 · 7 comments
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on

Comments

@ZxBing0066
Copy link

Initial checklist

Affected packages and versions

remark-parse: ^9|^10

Link to runnable example

No response

Steps to reproduce

https://codesandbox.io/s/remark-parser-strong-bug-1-yggwkm?file=/src/styles.css

**aaa(**123 will be parse to a paragraph without children which should be a paragraph with a strong children.

image

Expected behavior

It should be a strong block, this is broken with version 9 or 10, but works fine with version 8.

https://codesandbox.io/s/remark-parser-strong-bug-2-tlc8dd?file=/src/styles.css

image

Actual behavior

image

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 13, 2023
@ChristianMurphy
Copy link
Member

Welcome @ZxBing0066! 👋

This is a duplicate of #917

To quote the answer from there

A left-flanking delimiter run is a delimiter run that is (1) not followed by Unicode whitespace, and either (2a) not followed by a Unicode punctuation character, or (2b) followed by a Unicode punctuation character and preceded by Unicode whitespace or a Unicode punctuation character. For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.

And closing strong text

A right-flanking delimiter run is a delimiter run that is (1) not preceded by Unicode whitespace, and either (2a) not preceded by a Unicode punctuation character, or (2b) preceded by a Unicode punctuation character and followed by Unicode whitespace or a Unicode punctuation character. For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.

(https://spec.commonmark.org/0.30/#emphasis-and-strong-emphasis)

Don't seem to be met.

I'm not sure the HTML 1<strong>(abc)</strong>2 can be represented precisely/exactly in markdown.

A close equivalent may be adding zero width space characters between 1 and ** as well as ** and 2. 🤔

To answer your other comment

It should be a strong block, this is broken with version 9 or 10, but works fine with version 8.

remark 8 had a bug not implementing CommonMark correctly, that has been addressed in later versions and will remain fixed.

@ChristianMurphy ChristianMurphy closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2023
@github-actions

This comment has been minimized.

@github-actions
Copy link

Hi! Thanks for taking the time to contribute!

Because we treat issues as our backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn’t an exact duplicate but is closely related.

Thanks,
— bb

@github-actions
Copy link

github-actions bot commented Aug 13, 2023

Hi team! It seems this post is a duplicate, but hasn’t been marked as such. Please post a comment w/ Duplicate of #123(no final .) to do so. See GH docs for more info.

Thanks,
— bb

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Aug 13, 2023
@ZxBing0066
Copy link
Author

Hi @ChristianMurphy,

Thanks for you response, that's very helpful. However the current behavior still makes me confusing. If that is by design, I think **aaa\(**123 should be working since the punctuation character has been escaped. Just my own option.

@ChristianMurphy
Copy link
Member

In CommonMark **aaa\(**123 is not strong text either https://spec.commonmark.org/dingus/?text=**aaa%5C(**123
same in GitHub Flavored Markdown (GFM), **aaa\(**123 renders as **aaa(**123

@ZxBing0066
Copy link
Author

OK, you are right. Thanks for your patient answer~😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants