ele828 / hexo-prism-plugin

Hexo plugin for code highlighting by prism.js, supporting JSX syntax
205 stars 51 forks source link

fix: `captionRegex` matching error #31

Closed Jiasm closed 7 years ago

Jiasm commented 7 years ago

captionRegex matching error occurred when multiple code tags were present.

When some of this text appears in the markdown file:

image

contentText will be:

'<p><code>code</code>highlight</p>'+
'<pre><code class="javascript">'+
'let text = &#39;something code&#39;'+
'</code></pre>'+
'<p>something <code>wrong</code></p>'

And then, we get a wrong result: image

ele828 commented 7 years ago

Thanks for you contribution, this change has been included in version 2.2.0

Jiasm commented 7 years ago

You are welcome :)