fix(v2): parse headings directly after h1 properly (#4641)

This commit is contained in:
Alexey Pyltsyn 2021-04-19 11:10:24 +03:00 committed by GitHub
parent c8cf48a355
commit 808b0fa62a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -86,7 +86,7 @@ export function parseMarkdownContentTitle(
const content = contentUntrimmed.trim();
const regularTitleMatch = /^(?<pattern>#\s*(?<title>[^#\n]*)+\s*#*[\s\r]*?\n*?)/g.exec(
const regularTitleMatch = /^(?<pattern>#\s*(?<title>[^#\n]*)+[ \t]*#?\n*?)/g.exec(
content,
);
const alternateTitleMatch = /^(?<pattern>\s*(?<title>[^\n]*)\s*\n[=]+)/g.exec(