mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
Desktop: Split code block class in two (#5359)
This makes it clear that once class controls the background and the other controls the foreground
This commit is contained in:
parent
5d88a303dd
commit
a4785efd58
@ -484,7 +484,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
||||
border-radius: .25em;
|
||||
}
|
||||
|
||||
div.CodeMirror div.cm-jn-code-block {
|
||||
div.CodeMirror div.cm-jn-code-block-background {
|
||||
background-color: ${theme.codeBackgroundColor};
|
||||
padding-right: .2em;
|
||||
padding-left: .2em;
|
||||
|
@ -128,11 +128,11 @@ export default function useJoplinMode(CodeMirror: any) {
|
||||
} else if (state.outer.thisLine && state.outer.thisLine.fencedCodeEnd) {
|
||||
state.inCodeBlock = false;
|
||||
isMonospace = true;
|
||||
token = `${token} line-background-cm-jn-code-block`;
|
||||
token = `${token} line-cm-jn-code-block line-background-cm-jn-code-block-background`;
|
||||
} else if (state.outer.code === -1 || state.inCodeBlock) {
|
||||
state.inCodeBlock = true;
|
||||
isMonospace = true;
|
||||
token = `${token} line-background-cm-jn-code-block`;
|
||||
token = `${token} line-cm-jn-code-block line-background-cm-jn-code-block-background`;
|
||||
} else if (stream.pos > 0 && stream.string[stream.pos - 1] === '`' &&
|
||||
!!token && token.includes('comment')) {
|
||||
// This grabs the closing backtick for inline Code
|
||||
@ -184,7 +184,7 @@ export default function useJoplinMode(CodeMirror: any) {
|
||||
|
||||
state.inTable = false;
|
||||
|
||||
if (state.inCodeBlock) return 'line-background-cm-jn-code-block';
|
||||
if (state.inCodeBlock) return 'line-cm-jn-code-block line-background-cm-jn-code-block-background';
|
||||
|
||||
return null;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user