-
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
Markdown file with CRLF line endings will cause wrong-style output #423
Comments
I can confirm that text with Windows line endings (CLRF) is not handled correctly. My current workaround is to replace them before passing it to blackfriday: markdownWithUnixLineEndings := strings.Replace(markdown, "\r\n", "\n", -1)
blackfriday.Run([]byte(markdownWithUnixLineEndings)) |
Confirmed here as well. I have a WIP fix, but I'm not spending much time on Blackfriday lately, so haven't cleaned it up yet. |
Submitted #428, feel free to review and comment. |
For those that need a solution and can't wait for the PR to come up, this is what we did at Gitea to make it work in the meantime: go-gitea/gitea#8925 Basically, we convert every |
Here's the actual code: It just rips out all |
If you would prefer it replacing in place - then remove the definition of |
I just do a |
There were two problems with the rendering path. First, HTML standard requires POSTed text to use CRLF, but blackfriday processes this incorrectly (see russross/blackfriday#423). Brute-force this by replacing '\r\n' with '\n'. Secondly, the template was displaying Description rather than DescriptionHTML, and this was succeeding due to DiscussionFull being the top-level type. Fix this. Signed-off-by: George Dunlap <[email protected]>
To fix fenced code blocks. blackfriday doesn't handle CRLF well. See russross/blackfriday#423
Hi, When I started to use
blackfriday
to parse my Markdown file, I got a wrong-style output.My Markdown file looks like this, with Windows-style CRLF (\r\n) line endings:
# Hello World This is my content.
And I wrote the code like this in my project:
And now, when I ran my program, I got output in my console like this:
Is this a problem in
blackfriday
?Thanks.
The text was updated successfully, but these errors were encountered: