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

Inline code for tilde invalidly parsed as code block start #91

Closed
liushilive opened this issue Nov 6, 2019 · 4 comments
Closed

Inline code for tilde invalidly parsed as code block start #91

liushilive opened this issue Nov 6, 2019 · 4 comments
Assignees
Labels

Comments

@liushilive
Copy link

The sample code

* `~` home

analytical result

image

chrisjsewell added a commit to executablebooks/mistletoe-ebp that referenced this issue Mar 11, 2020
@pbodnar pbodnar added the bug label Sep 17, 2021
@pbodnar
Copy link
Collaborator

pbodnar commented Sep 17, 2021

This seems easy to fix - the regex pattern needs to accept either just backticks, or just tildes. The linked fix seems a little bit more complicated though...

@pbodnar pbodnar changed the title Inline code parsing error Inline code for tilde invalidly parsed as block code start Sep 18, 2021
@pbodnar pbodnar changed the title Inline code for tilde invalidly parsed as block code start Inline code for tilde invalidly parsed as code block start Sep 18, 2021
@pbodnar pbodnar self-assigned this Sep 18, 2021
@pbodnar
Copy link
Collaborator

pbodnar commented Sep 18, 2021

OK, so I fixed this in the master.

Note that there is still another bug, possibly also in the linked patch from @chrisjsewell, which incorrectly rejects a fenced code block like this:

~~~ lang myextra_params_containing_~
code block
~~~

GitHub renders this correctly:

code block

... because https://spec.commonmark.org/0.30/#info-string clearly states that:

Info strings for tilde code blocks can contain backticks and tildes

@pbodnar pbodnar closed this as completed Sep 18, 2021
@chrisjsewell
Copy link
Contributor

Heya, I would just note that I moved on from mistletoe, since it didn't quite have the features I needed, and went on to create https://github.com/executablebooks/markdown-it-py (and port for the widely used markdown-it)

@pbodnar
Copy link
Collaborator

pbodnar commented Sep 18, 2021

Hi Chris, yeah, I've already noticed very well when doing triage of opened issues and PRs here, and I wish you good luck with your project. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants