Hexo & pandoc parsing differences for code blocks in lists #766
-
Hi. I am using hexo-renderer-pandoc to convert markdown to html. For the following lines: 1. ```
code
```
2. ```
more code
``` The output of pandoc: <ol type="1">
<li><pre><code>code</code></pre></li>
<li><pre><code>more code</code></pre></li>
</ol> Is this a bug in hexo? Here is my pandoc:
args:
- "-f"
- "gfm" # 默认的 "markdown" 不稳定
- "-t"
- "html"
- "--mathjax" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, I think this is a bug in Hexo. Hexo pre-processes code blocks with regular expressions and performs code highlighting before pandoc processing (instead of using pandoc's default code blocks). The regular expression used by Hexo fails to handle your case correctly. However, I believe this bug might be difficult to fix. You could try to work around this issue, for example, by adding extra blank lines. |
Beta Was this translation helpful? Give feedback.
Yes, I think this is a bug in Hexo. Hexo pre-processes code blocks with regular expressions and performs code highlighting before pandoc processing (instead of using pandoc's default code blocks). The regular expression used by Hexo fails to handle your case correctly. However, I believe this bug might be difficult to fix. You could try to work around this issue, for example, by adding extra blank lines.