New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodeMirror Highlighing not work #421
Comments
@jaywcjlove can you help me? |
Please provide an example using https://codesandbox.io/ @nuo-promise |
|
@nuo-promise https://codesandbox.io/embed/sad-mirzakhani-19i64b?fontsize=14&hidenavigation=1&theme=dark deleted |
Still handling style through createTheme is powerful! Ths |
`
import {
syntaxHighlighting,
HighlightStyle,
defaultHighlightStyle
} from '@codemirror/language';
const myHighlightStyle = HighlightStyle.define([
{ tag: tags.keyword, color: '#FC6' },
{ tag: tags.comment, color: '#16A004', fontStyle: 'italic' },
{ tag: tags.strong, color: '#66D9EF', fontStyle: 'bold' },
{
tag: tags.heading1,
fontSize: '1.6em',
fontWeight: 'bold'
},
{
tag: tags.heading2,
fontSize: '1.4em',
fontWeight: 'bold'
},
{
tag: tags.heading3,
fontSize: '1.2em',
fontWeight: 'bold'
}
]);
extensions={[
syntaxHighlighting(defaultHighlightStyle),
syntaxHighlighting(myHighlightStyle),
transparentTheme,
scrollBottom,
javascript({ jsx: true }),
markdown({
base: markdownLanguage,
codeLanguages: languages,
addKeymap: true
}),
EditorView.lineWrapping
]}
`
The text was updated successfully, but these errors were encountered: