hexojs / hexo-renderer-marked

Markdown renderer for Hexo
MIT License
179 stars 94 forks source link

Math formula rendering issue with `hexo-renderer-marked@6.3.0` #294

Closed sitJac closed 2 months ago

sitJac commented 2 months ago

Check List

Describe the bug

When using hexo-renderer-marked@6.3.0 to build my blog system, there is an issue with rendering math formulas.

For example, the following math formula:

$$
\begin{cases}
u = f_x \frac{X}{Z} + c_x \\
v = f_y \frac{Y}{Z} + c_y
\end{cases}
$$

is supposed to be rendered as a two-line formula: g

However, it is actually rendered as a single line: Actual Rendering

Expected behavior

The math formula should be rendered as a two-line formula.

How to reproduce

  1. Install hexo-renderer-marked@6.3.0 in a Hexo project.
  2. Add the above math formula to a Markdown file.
  3. Generate the site using hexo generate.
  4. Open the generated HTML file in a browser.

Screenshots

No response

Environment information

- Hexo version: 7.3.0
- hexo-renderer-marked version: 6.3.0
- Node.js version: 16.20.2
- OS: Ubuntu 20.04

Additional context

No response

uiolee commented 2 months ago

As I know, marked is a renderer of markdown, not math.

the render result of marked

sitJac commented 2 months ago

Using the following dependency versions, the issue does not occur. I am closing this issue now:

{
  "dependencies": {
    "hexo": "^6.0.0",
    "hexo-asset-image": "^1.0.0",
    "hexo-deployer-git": "^3.0.0",
    "hexo-filter-mathjax": "^0.8.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-searchdb": "^1.4.1",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^5.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-next": "^8.10.1",
    "highlight.js": "^11.9.0"
  }
}