next-theme / hexo-filter-mathjax

💯 Server side MathJax renderer plugin for Hexo.
https://www.npmjs.com/package/hexo-filter-mathjax
MIT License
105 stars 6 forks source link

Spaces before inline math is removed by hexo-html-minifier #42

Closed ppwwyyxx closed 2 years ago

ppwwyyxx commented 2 years ago

My markdown looks like this:

flipped by  $i \leftarrow W - 1 - i$

Before, I was using frontend rendering with mathjax javascript library. The space between "by" and the inline math is kept. I got result like this: 2022-02-27_22-49

After using hexo-filter-mathjax, the space disappeared and I got this: 2022-02-27_22-50

I can also see from the raw html that the space is gone.

Is this a problem of hexo-filter-mathjax? How can I let it render the space properly?

Options that I use:

mathjax:
  tags: none # or 'ams' or 'all'
  single_dollars: true # enable single dollar signs as in-line math delimiters
  cjk_width: 0.9 # relative CJK char width
  normal_width: 0.6 # relative normal (monospace) width
  append_css: true # add CSS to pages rendered by MathJax
  every_page: false # if true, every page will be rendered by MathJax regardless the `mathjax` setting in Front-matter
  extension_options: {}
stevenjoezhang commented 2 years ago

It's correct on my website, and the space between "by" and the inline math is kept.

截屏2022-03-07 下午4 21 39

I don't think it's a problem of hexo-filter-mathjax. Maybe the space is removed by other Hexo renderer plugin.

ppwwyyxx commented 2 years ago

Thanks for your response! I've resolved the issue after setting collapseWhitespace=false in https://github.com/hexojs/hexo-html-minifier