Skip to content

Commit

Permalink
Update Header.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Cross1111 committed Oct 11, 2024
1 parent 42418b6 commit 7ec6f47
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/core/hooks/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,6 @@ export default class Header extends ParagraphBase {
// atx header
const atx = {
begin: '(?:^|\\n)(\\n*)(?:\\h{0,}(#{1,6})(?:\\s+|$))', // (?<lines>\\n*), (?<level>#{1,6})
// begin: 匹配标题的开始部分
// (?:^|\\n) : 非捕获组,匹配字符串的开始位置(^)或换行符(\\n)
// (\\n*) : 捕获组,匹配任意数量的换行符,可能用于后续处理(例如,计算缩进级别)
// (?:\\h{0,}(#{1,6})(?:\\s+|$)) : 非捕获组,用于匹配标题的级别和可选的后续空格或行尾
// \\h{0,} : 匹配任意数量的水平空白字符(空格、制表符等),但此处由于后面紧跟#{1,6},所以实际上这个部分可以省略,因为#前的空格在Markdown中通常被忽略
// (#{1,6}) : 捕获组,匹配1到6个#字符,表示标题的级别(1级到6级)
// (?:\\s+|$) : 非捕获组,要求要么有一个或多个空格
content: '(.+?)', // '(?<text>.+?)'
end: '(?=$|\\n)',
};
Expand Down

0 comments on commit 7ec6f47

Please sign in to comment.