-
Notifications
You must be signed in to change notification settings - Fork 181
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
Fence code blocks and nested lists inconsistencies #124
Comments
Could you provide a minimized test-case so that I can test it with https://babelmark.github.io/ For reference, those are related (?) issues from blackfriday:
|
I ran into this same issue today. This is a minimized test-case: 1. Some item ```java int a = 3; ``` 1. Another item Output: <ol>
<li>Some item
<code>
java
int a = 3;
</code></li>
<li>Another item</li>
</ol> I've been investigating a bit this issue, and it seems that there is a bug in Line 126 in 412bcf1
It counts the number of backticks, but then it doesn't use that information to determine if it has to create an &ast.CodeBlock{} or an &ast.Code{}. It just creates the &ast.Code{}. Will create a PR if I can make it work. |
Initially reported at russross/blackfriday#536
I am working on a Hugo project that uses blackfriday internally to render its content.
This is the nested list that I am using:
I can not get this to render consistently due to the below reasons.
Fenced blocks within nested lists appear as inline code (when not preceded by empty new line)
![image](https://user-images.githubusercontent.com/6129517/56084692-594d1b00-5e54-11e9-8d09-ff3c906b408d.png)
The above sample produces this:
The only way to get the code block to render properly is to add a new blank line before the fenced code (and further intent it) which gives this:
![image](https://user-images.githubusercontent.com/6129517/56085309-72f36000-5e5e-11e9-8dcb-48807bcb1205.png)
But this hack leads to another issue.
The addition of the new line before the fence code in a list, surrounds the corresponding and all subsequent bullet contents in paragraph tags ie.
<li><p>...</p></li>
(even those which were earlier simply rendered as<li>...</li>
). Similar behaviour was also reported at gohugoio/hugo#5291.This becomes prominent by the extra paragraph padding at the top level lists (2. Set API Keys...., 3. Optionally set Proxy.... ) in the screenshot above.
In all likelihood, I can at least made things look consistent by adding some extra css like
However, this doesn't address the underlying issue directly:
Expected Output:
The text was updated successfully, but these errors were encountered: