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 for issue russross/blackfriday#239 #372

Merged
merged 5 commits into from
May 24, 2018
Merged

Fix for issue russross/blackfriday#239 #372

merged 5 commits into from
May 24, 2018

Conversation

client9
Copy link

@client9 client9 commented Jun 11, 2017

Fix for issue #239

This appears to also work in V1, although this PR is for V2

The following would confuse the - codeline as if it were a start of a nested list.

- line

    ```
    - codeline
    ```

The PR checks if a code fence is found, and don't use code to figure out if a list item has ended.

a code review is most welcome as I'm sure I'm missing something.

thanks!

n

@rtfb
Copy link
Collaborator

rtfb commented Jun 25, 2017

Looks good. How does it work with an unclosed code block? Like this:

- line

    ```
    - codeline

That's a malformed markdown, of course, and any behavior is almost as good as any other, but I want to make sure no source text gets omitted.

@client9
Copy link
Author

client9 commented Jul 2, 2017

I'll check... also, are there any issues with markdown parsing options, so that this needs to be turned on or off?

@rtfb
Copy link
Collaborator

rtfb commented Jul 9, 2017

are there any issues with markdown parsing options, so that this needs to be turned on or off?

Oh I'm glad you asked, because it slipped my attention. Looks like your fix should be conditional and do nothing with FencedCode turned off. With no fenced code, that seems to be a valid sublist.

And while you're at it, can you please add a test case for a non-fenced code block with sublist-like content?

@kaushalmodi
Copy link

Looking forward to this getting merged. Thanks for working on the fix!

@tfogo
Copy link
Contributor

tfogo commented May 21, 2018

Hey @client9 are you planning on continuing work on this fix? It would be fantastic to have #239 fixed.

tfogo and others added 2 commits May 22, 2018 23:53
@client9
Copy link
Author

client9 commented May 24, 2018

@rtfb please re-view. Thanks to excellent work by @tfogo , we have the tests and conditional that you requested.

@rtfb
Copy link
Collaborator

rtfb commented May 24, 2018

LGTM, thanks a bunch, @client9 and @tfogo!!

@rtfb rtfb merged commit 8c0d4cc into russross:v2 May 24, 2018
@tfogo
Copy link
Contributor

tfogo commented May 24, 2018

Awesome thanks @rtfb! Thanks @client9 for the heavy lifting!

rtfb pushed a commit that referenced this pull request Aug 29, 2018
This is a backport of the initial fix in v2 (#372).
willdollman pushed a commit to willdollman/blackfriday that referenced this pull request Feb 27, 2021
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.

4 participants