hexo-renderer-marked icon indicating copy to clipboard operation
hexo-renderer-marked copied to clipboard

Why are they(`<`, `>`) treated differently ?

Open Mahoo12138 opened this issue 2 years ago • 0 comments

This a test post: source/_posts/test.md:

```bash
test >< >><< <name>
```.

hexo.extend.filter.register('after_post_render', (data) => {
  console.log(data.content)
  // ...
}

Here is the hexo log:

<pre>
  <code class="language-bash">
    <span class="token function">test</span> 
    <span class="token operator">></span>
    <span class="token operator">&lt;</span> 
    <span class="token operator">>></span>
    <span class="token operator">&lt;&lt;</span> 
    <span class="token operator">&lt;</span>
    name
    <span class="token operator">></span>
  </code>
</pre>

So I used the the primitive marked to handle this post content:

npx marked source/_posts/test.md  -o test.html
<pre><code class="language-bash">test &gt;&lt; &gt;&gt;&lt;&lt; &lt;name&gt;</code></pre>

So what can I do for eliminating this, thx !

Some useful information

  • hexo-renderer-marked: "2.0.0"

Mahoo12138 avatar Aug 31 '22 07:08 Mahoo12138