hexojs / hexo-renderer-pandoc

A pandoc-markdown-flavor renderer for hexo.
https://npmjs.com/hexo-renderer-pandoc
MIT License
114 stars 32 forks source link

How to escape dollar signs? #61

Closed TripleCamera closed 4 months ago

TripleCamera commented 7 months ago

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
TripleCamera commented 7 months ago

None of the following could escape dollar sign, either:

😞

uiolee commented 7 months ago

demo

inline backtick code or fenced backtick code

spec

https://spec.commonmark.org/0.31.2/#code-spans

https://spec.commonmark.org/0.31.2/#fenced-code-blocks

uiolee commented 7 months ago

can not reproduce.

Backslashes can escape dollar signs.


hexo preview

image

TripleCamera commented 7 months ago

can not reproduce.

Backslashes can escape dollar signs.

Which theme & math engine are you using?

TripleCamera commented 7 months ago

@uiolee Ping~

uiolee commented 7 months ago

with next theme and mathjax enable

image


\$sigle escaped math\\$ will works

image

uiolee commented 7 months ago

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

TripleCamera commented 7 months ago

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