1
0
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:
Caleb John 2021-08-21 02:34:54 -07:00 committed by GitHub
parent 5d88a303dd
commit a4785efd58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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;
},