Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当有多个H1标签,TOC高亮会多个一同显示,当我从H1开始渲染就可以了。 #40

Open
1368590868 opened this issue Feb 13, 2023 · 0 comments

Comments

@1368590868
Copy link

.replace(/^[^#]+\n/g, '')
.replace(/(?:[^\n#]+)#+\s([^#\n]+)\n*/g, '') // 匹配行内出现 # 号的情况
.replace(/^\s[^#\n]*\n+/, '')
.replace(/[^`\n]*\n+[^]+```\n+/g, '')
.replace(/([^\n]+)`/g, '$1')
.replace(/**?([^*\n]+)**?/g, '$1')
.replace(/?([^_\n]+)?/g, '$1')
.trim();

替换正则从H1开始渲染

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant