-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Code blocks not rendered correctly in lists #2928
Comments
Assuming you use Blackfriday, please post an issue here: https://github.com/russross/blackfriday/issues And link back to this issue. |
You should post the entire description on the BF issue, not just a link back here. |
This works
Simply put an extra newline between each list item. I do not know if this is a hack, or if this is how it supposed to be done. But I have learned doing that by trial and error :) https://scripter.co/get-current-directory-name-without-path/ |
Reported a similar/same issue. The hack mentioned above breaks the ordering in an ordered list, so it doesn't really work. Linked issue includes a demo markdown file and says specifically what is wrong in the generated HTML. |
?? HTML <ol>
<li>
<p>awk</p>
<div class="highlight">
<pre><code class="language-sh" data-lang="sh"><span></span><span class="nb">pwd</span> <span class="p">|</span> awk -F/ <span class="s1">'{print $NF}'</span>
</code></pre>
</div>
</li>
<li>
<p>rev and cut</p>
<div class="highlight">
<pre><code class="language-sh" data-lang="sh"><span></span><span class="nb">pwd</span> <span class="p">|</span> rev <span class="p">|</span> cut -d/ -f <span class="m">1</span> <span class="p">|</span> rev
</code></pre>
</div>
</li>
<li>
<p>basename</p>
<div class="highlight">
<pre><code class="language-sh" data-lang="sh"><span></span>basename <span class="sb">`</span><span class="nb">pwd</span><span class="sb">`</span>
</code></pre>
</div>
</li>
</ol> |
I see. If you put a newline after the code block but not before it, the numbering is maintained. If you put an empty line before the code block as well as after, the numbering is not maintained. I don't know if that is expected behavior, but it is certainly surprising to me. |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
I believe this issue can be closed as |
Workaround I currently use: 8 space indentation to get the code block. {{< highlight ... >}} to get syntax highlighting if I want it that badly. Close it for hugo. |
This has been fixed recently in russross/blackfriday#476 and russross/blackfriday#521. It would be great to update the blackfriday dependence to include these fixes. |
Did the update from BlackFriday ever get merged into Hugo? I'm still seeing weird code-block stuff. Here's my Markdown for the image above: #### Run the Installation
1. Connect to your machine via SSH or open a terminal if you are working on a local installation.
2. Change to your root `~` directory and update your system:
```bash
cd ~
sudo apt update -y && sudo apt upgrade -y
```
3. Download the latest [package](https://github.com/exampleproject/releases) to your computer if you haven't already. You can also use `wget` if you'd prefer:
```bash
wget https://github.com/exampleproject/release.tar.bz2
```
4. Unzip the package and move the directory to your home `~` directory: |
I'm also face this issue, it seems be fixed in the blackfriday, but in hugo this issue still exists. |
Make changes for: - russross/blackfriday#495 - gohugoio/hugo#2928 (comment)
Yup, same issue here |
No longer reproducible with v0.82 using default markdown renderer (Goldmark). |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This markdown:
Renders as:
bla bla
javascript var message = 'hello'; console.log(message);
The text was updated successfully, but these errors were encountered: