1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Desktop: Place code-block background in the back in Markdown editor (#5322)

This commit is contained in:
Caleb John 2021-08-16 23:13:52 -07:00 committed by Laurent Cozic
parent 4df434e63e
commit e51fe8bd80
2 changed files with 4 additions and 4 deletions

View File

@ -483,7 +483,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
border-radius: .25em;
}
div.CodeMirror pre.cm-jn-code-block {
div.CodeMirror div.cm-jn-code-block {
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-cm-jn-code-block`;
token = `${token} line-background-cm-jn-code-block`;
} else if (state.outer.code === -1 || state.inCodeBlock) {
state.inCodeBlock = true;
isMonospace = true;
token = `${token} line-cm-jn-code-block`;
token = `${token} line-background-cm-jn-code-block`;
} 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-cm-jn-code-block';
if (state.inCodeBlock) return 'line-background-cm-jn-code-block';
return null;
},