diff --git a/src/main/utils/index.js b/src/main/utils/index.js index 8af6e19a..aff766bb 100644 --- a/src/main/utils/index.js +++ b/src/main/utils/index.js @@ -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,}(.+)/)