Skip to content

Commit

Permalink
fix: 修复目录不展示的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Oct 9, 2022
1 parent 44935d9 commit 8308b5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/hooks/Toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default class Toc extends ParagraphBase {
afterMakeHtml(str) {
let $str = super.afterMakeHtml(str);
const headerList = [];
const headerRegex = /<h([1-6]) id="([^"]+?)" data-sign=".+?" data-lines="[0-9]+"><a[^/]+?\/a>(.+?)<\/h\1>/g;
const headerRegex = /<h([1-6])[^>]*? id="([^"]+?)"[^>]*?>(?:<a[^/]+?\/a>|)(.+?)<\/h\1>/g;
let str2Md5 = '';
$str.replace(headerRegex, (match, level, id, text) => {
const $text = text.replace(/~fn#[0-9]+#/g, '');
Expand Down

0 comments on commit 8308b5c

Please sign in to comment.