hexojs/hexo-renderer-pandoc

图片块解析错误!

siaimes opened this issue · 2 comments

My summary of the issue:
when having these lines (a code block immediately followed by image embed) in a post.md, the rendered result includes undesired caption,
1

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">code block</span><br></pre></td></tr></table></figure>
<figure>
<img src="https://postimgs.org/img/logo.png" alt="" /><figcaption>another thing</figcaption>
</figure>

but no caption when code block + image + code block,
2

also no caption with image + code block
3

I'm using v0.3.0 with pandoc 2.7.3


It seems to be an intended feature of pandoc. There are two ways to disable the caption,

  1. Through hexo's _config.yml:
pandoc:
  extensions:
    - '-implicit_figures'
  1. Add a backslash and a space after image embed:
![alt text](https://postimgs.org/img/logo.png)\ 

Ok, I know what to do. Thank you guys for answering my questions, thank you very much.