mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 11:50:52 +08:00
Update index.js
This commit is contained in:
parent
f09b1bda77
commit
c59b3ad423
@ -12,7 +12,7 @@ export const getUniqueId = () => {
|
||||
export const getRecommendTitleFromMarkdownString = markdown => {
|
||||
// NOTE: We should read the title from the renderer cache because this regex matches in
|
||||
// code blocks too.
|
||||
const tokens = markdown.match(/#{1,6} {1,}(.*\S.*)(?:\n|$)/g)
|
||||
const tokens = markdown.match(/#{1,6} {1,}(?! )(.*\S.*)(?:\n|$)/g)
|
||||
if (!tokens) return ''
|
||||
const headers = tokens.map(t => {
|
||||
const matches = t.trim().match(/(#{1,6}) {1,}(.+)/)
|
||||
|
Loading…
Reference in New Issue
Block a user