hexojs/hexo-renderer-pandoc

How to escape dollar signs?

Closed this issue · 8 comments

How to escape dollar signs if I don't want math formulas?

Source code:

$math$

\$escaped math\$

\\$double escaped math\\$

Output: All of them are displayed as math formulas. The third one has a backslash at the beginning.

_config.yml:

pandoc:
  args:
    - "-f"
    - "gfm"
    - "-t"
    - "html"
    - "--mathjax"

_config.next.yml:

math:
  mathjax:
    enable: true

None of the following could escape dollar sign, either:

  • $html escaped math$
  • $<!---->comment escaped math<!---->$
  • <span>$</span>tag escaped math<span>$</span>

😞

can not reproduce.

Backslashes can escape dollar signs.


hexo preview

image

can not reproduce.

Backslashes can escape dollar signs.

Which theme & math engine are you using?

with next theme and mathjax enable

image


\$sigle escaped math\\$ will works

image

hexo-renderer-pandoc just simply transpile markdown.In my tests, hexo-renderer-pandoc and hexo both rendered the correct results

the rendering and displaying formulas is determined by the math engine or theme.
I think this has nothing to do with pandoc or hexo

All right. I just posted a discussion at next-theme/hexo-theme-next#765.