hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.2k stars 4.82k forks source link

怎么关闭4格空格变成代码块 #5165

Closed 1976083684 closed 1 year ago

1976083684 commented 1 year ago

Check List

Please check followings before submitting a new issue.

Expected behavior

Actual behavior

How to reproduce?

Is the problem still there under "Safe mode"?

Environment & Settings

Node.js & npm version(node -v && npm -v)

Your site _config.yml (Optional)

Hexo and Plugin version(npm ls --depth 0)

Your package.json package.json

Others

1976083684 commented 1 year ago

TAB缩进(4),还是会变成代码块,好烦恼,我的文章是从typora移植过来的,基本文章开头都是4个空格缩进,结果文章都变成代码块了,欸

1976083684 commented 1 year ago

怎么解决呢,好烦,感觉又不方便了

stevenjoezhang commented 1 year ago

这个语法叫做 Indented code block,Hexo 用的 marked 默认是启用的,改起来有点麻烦

WangNianyi2001 commented 1 year ago

你可以写个 batch 或者 shell 脚本把你的博客源码批量处理一下。另外,请遵守 issue 格式。

leesei commented 1 year ago

For your reference, you can use this regex to replace leading space to empty string. ^[ ]{4} match only 4 spaces at the start of line ^[ ]{4,} match only 4 or more spaces at the start of line

https://regex101.com/r/DIR3UC/1