From c59b3ad423dfa082869933baf9f5d5c69bdcc560 Mon Sep 17 00:00:00 2001 From: mmmsssttt404 <931121963@qq.com> Date: Tue, 25 Mar 2025 16:08:46 +0800 Subject: [PATCH] Update index.js --- src/main/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,}(.+)/)