diff --git a/src/codemirror/liveMarkdownDecorations.js b/src/codemirror/liveMarkdownDecorations.js index 07b57d9..db4ced0 100644 --- a/src/codemirror/liveMarkdownDecorations.js +++ b/src/codemirror/liveMarkdownDecorations.js @@ -399,6 +399,21 @@ const buildDecorations = (state, filePath) => { to: nodeTo, value: Decoration.mark({ class: 'cm-md-link-text' }) }) + } else { + // 编辑状态:给链接的语法标记添加样式,使其可见且颜色正确 + let cursor = node.node.cursor() + if (cursor.firstChild()) { + do { + const subType = cursor.type.name + if (subType === 'LinkMark' || subType === 'URL' || subType === 'LinkTitle') { + decorations.push({ + from: cursor.from, + to: cursor.to, + value: Decoration.mark({ class: 'cm-md-syntax' }) + }) + } + } while (cursor.nextSibling()) + } } } diff --git a/src/components/LivePreviewEditor.vue b/src/components/LivePreviewEditor.vue index d29ff5d..99cf730 100644 --- a/src/components/LivePreviewEditor.vue +++ b/src/components/LivePreviewEditor.vue @@ -1,299 +1,305 @@ diff --git a/src/main.css b/src/main.css index 983d9d2..280b584 100644 --- a/src/main.css +++ b/src/main.css @@ -10,10 +10,10 @@ --border-color: #f0f0f0; --hover-background: rgba(0, 0, 0, 0.04); --scrollbar-thumb: rgba(0, 0, 0, 0.28); - --app-font-size: 15px; - --editor-font-size: 15px; - --preview-font-size: 15px; - --preview-code-font-size: 15px; + --app-font-size: 16px; + --editor-font-size: 17px; + --preview-font-size: 16px; + --preview-code-font-size: 16px; } html,