ele828 / hexo-prism-plugin

Hexo plugin for code highlighting by prism.js, supporting JSX syntax
204 stars 51 forks source link

有计划支持 TSX 么? #53

Open rxliuli opened 4 years ago

rxliuli commented 4 years ago

在使用插件渲染 tsx 的代码时会出现问题

https://github.com/blinkfox/hexo-theme-matery/issues/304

图解

image

发生问题的仓库: https://github.com/rxliuli/blog

配置项

highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace:

# 替换 hexo 默认的代码高亮
prism_plugin:
  mode: 'preprocess' # realtime/preprocess
  theme: 'tomorrow'
  line_number: true # default false
  custom_css:

不知道发生了什么,有什么解决方案么? 实测了一下,是因为不支持 tsx 的语法高亮时默认将之当成了普通的 markdown 中的 HTML(默认不应该当作文本么?)

image

Zhou-Bill commented 4 years ago

how to solve?

rxliuli commented 4 years ago

how to solve?

使用 jsx

```jsx ```

Zhou-Bill commented 4 years ago

how to solve?

使用 jsx

谢了