diff --git a/client/components/codeEditor/customHighlight.js b/client/components/codeEditor/customHighlight.js index 148615833..38a5dbba8 100644 --- a/client/components/codeEditor/customHighlight.js +++ b/client/components/codeEditor/customHighlight.js @@ -22,6 +22,7 @@ export function tokenizeCustomMarkdown(text) { const tokens = []; const lines = text.split('\n'); + console.log(tags); lines.forEach((lineText, lineNumber)=>{ // --- Page / snippet lines --- if(/^(?=\\page(?:break)?(?: *{[^\n{}]*})?$)/m.test(lineText)) tokens.push({ line: lineNumber, type: customTags.pageLine }); @@ -230,10 +231,22 @@ export function tokenizeCustomMarkdown(text) { export const customHighlightStyle = HighlightStyle.define([ { tag: tags.heading, class: 'cm-header' }, { tag: tags.heading1, class: 'cm-header cm-header-1' }, - { tag: tags.keyword, color: '#07a' }, // example for your markdown headings + { tag: tags.heading2, class: 'cm-header cm-header-2' }, + { tag: tags.heading3, class: 'cm-header cm-header-3' }, + { tag: tags.heading4, class: 'cm-header cm-header-4' }, + { tag: tags.heading5, class: 'cm-header cm-header-5' }, + { tag: tags.heading6, class: 'cm-header cm-header-6' }, + { tag: tags.link, class: 'cm-link' }, + { tag: tags.string, class: 'cm-string' }, + { tag: tags.url, class: 'cm-string cm-url' }, + { tag: tags.list, class: 'cm-list' }, + { tag: tags.strong, class: 'cm-strong' }, + { tag: tags.emphasis, class: 'cm-em' }, + + { tag: customTags.pageLine, color: '#f0a' }, { tag: customTags.snippetLine, class: 'cm-snippetLine', color: '#0af' }, - { tag: customTags.inlineBlock, class: 'cm-inline-block', backgroundColor: '#fffae6' }, + { tag: customTags.inlineBlock, class: 'cm-inline-block' }, { tag: customTags.emoji, class: 'cm-emoji', color: '#fa0' }, { tag: customTags.superscript, class: 'cm-superscript', verticalAlign: 'super', fontSize: '0.8em' }, { tag: customTags.subscript, class: 'cm-subscript', verticalAlign: 'sub', fontSize: '0.8em' }, diff --git a/client/homebrew/editor/editor.less b/client/homebrew/editor/editor.less index 56e14cf1c..a9d7383f9 100644 --- a/client/homebrew/editor/editor.less +++ b/client/homebrew/editor/editor.less @@ -60,16 +60,16 @@ .cm-block:not(.cm-comment) { font-weight : bold; color : purple; - //font-style: italic; } .cm-inline-block:not(.cm-comment) { font-weight : bold; - color : red; - //font-style: italic; + color : red ; + span { color : inherit } } .cm-injection:not(.cm-comment) { font-weight : bold; color : green; + span { color : inherit } } .cm-emoji:not(.cm-comment) { padding-bottom : 1px; diff --git a/themes/codeMirror/customThemes/default.js b/themes/codeMirror/customThemes/default.js index 1fa1ddace..d6974c255 100644 --- a/themes/codeMirror/customThemes/default.js +++ b/themes/codeMirror/customThemes/default.js @@ -62,18 +62,18 @@ export const defaultCM5Theme = EditorView.theme({ ".cm-atom": { color: "#219" }, ".cm-number": { color: "#164" }, ".cm-def": { color: "#00f" }, - ".cm-variable-2": { color: "#05a" }, + ".cm-list": { color: "#05a" }, ".cm-variable-3, .cm-type": { color: "#085" }, ".cm-comment": { color: "#a50" }, - ".cm-string": { color: "#a11" }, - ".cm-string-2": { color: "#f50" }, + ".cm-link": { color: "#00c", textDecoration: "underline" }, + ".cm-string": { color: "#a11", textDecoration: "none" }, + ".cm-string-2": { color: "#f50", textDecoration: "none" }, ".cm-meta, .cm-qualifier": { color: "#555" }, ".cm-builtin": { color: "#30a" }, ".cm-bracket": { color: "#997" }, ".cm-tag": { color: "#170" }, ".cm-attribute": { color: "#00c" }, ".cm-hr": { color: "#999" }, - ".cm-link": { color: "#00c", textDecoration: "underline" }, ".cm-negative": { color: "#d44" }, ".cm-positive": { color: "#292" }, ".cm-error, .cm-invalidchar": { color: "#f00" },