Override default highlighting style to remove ugly underline on heading tags

This commit is contained in:
Jonatan Heyman 2023-03-03 00:56:06 +01:00
parent 0d7c04991f
commit 3aa9e5d512

View File

@ -1,6 +1,9 @@
import { EditorView } from "@codemirror/view";
import { HighlightStyle, syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language';
import { tags } from '@lezer/highlight';
export const heynoteLight = EditorView.theme({
const lightTheme = EditorView.theme({
"&": {
backgroundColor: "#fff",
},
@ -37,4 +40,16 @@ export const heynoteLight = EditorView.theme({
},
})
const highlightStyle = HighlightStyle.define([
...defaultHighlightStyle.specs,
// override heading style, in order to remove the ugly underline
{ tag: tags.heading, fontWeight: 'bold'},
])
const heynoteLight = [
lightTheme,
syntaxHighlighting(highlightStyle),
];
export { heynoteLight };