-
Notifications
You must be signed in to change notification settings - Fork 602
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
Block parsing for fenced code blocks with syntax highlighting in lists regression. #495
Comments
I have a lead. Modifying the code as follows seems to fix the issue, at least for that one instance of the problematic input: -_, marker := isFenceLine(chunk, nil, codeBlockMarker, false)
+_, marker := isFenceLine(chunk, new(string), codeBlockMarker, false) I.e., passing a non-nil |
I came here to report a similar issue which sounds like it might have the same cause, right now if a fenced code block immediately follows a list even if it's not indented it becomes part of the list. The following patch adds a test that can be used to demonstrate the behavior (the expected result might have wrong newlines, I just guessed):
EDIT: The above is against the v2 branch, but just noticed that this has the v1 label. Not sure if it's the same or not. |
+1 the same issue here |
Thank you very much for resolving this issue, @aignas and @rtfb! You've also indirectly resolved shurcooL/markdownfmt#44. |
The intention is to make it so that it's possible to import and use this package in module mode (in addition to the well-supported GOPATH mode), and have it build successfully. That doesn't happen automatically because the latest version of the module that provides the github.com/russross/blackfriday package (the v1 API) is an v2.0.0+incompatible version that provides the v2 API, which is not compatible. Use the latest pseudo-version of blackfriday v1 API. Can't use the latest tagged release version v1.5.2 because it doesn't include an important bug fix for russross/blackfriday#495. Only specify the blackfriday version in go.mod; others are unspecified to avoid the added burden of maintaining and updating them. The latest version, whichever they are, are fully supported, just like in GOPATH mode. Fixes #47
Make changes for: - russross/blackfriday#495 - gohugoio/hugo#2928 (comment)
There is now a released version of blackfriday v1 that includes the bug fix for russross/blackfriday#495 that our tests rely on. Start using it instead of an older pseudo-version. Updates #47. Updates russross/blackfriday#587.
There is now a released version of blackfriday v1 that includes the bug fix for russross/blackfriday#495 that our tests rely on. Start using it instead of an older pseudo-version. Updates #47. Updates russross/blackfriday#587.
This attempts to fix russross#495 and russross#485. Note the test cases which were added at the bottom of the list. The first added test case was passing even before the changes, but the second was not.
#715 Same issue on V2 |
I've just discovered PR #476 is causing the following regression in v1. /cc @tfogo @client9
Given this Markdown input:
Everything works as expected:
However, if one uses a fenced code block with syntax highlighting, everything that comes after the fenced code block ends up being a part of "list entry 1":
I.e., it parses as if the input was:
The text was updated successfully, but these errors were encountered: