Skip to content
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

Closed
nuo-promise opened this issue Nov 26, 2022 · 8 comments
Closed

CodeMirror Highlighing not work #421

nuo-promise opened this issue Nov 26, 2022 · 8 comments

Comments

@nuo-promise
Copy link

`
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
]}
`

@nuo-promise
Copy link
Author

@jaywcjlove can you help me?

@nuo-promise
Copy link
Author

nuo-promise commented Nov 26, 2022

image

@nuo-promise
Copy link
Author

should next
image

@jaywcjlove
Copy link
Member

Please provide an example using https://codesandbox.io/ @nuo-promise

@nuo-promise
Copy link
Author

Please provide an example using https://codesandbox.io/ @nuo-promise

https://codesandbox.io/s/smoosh-violet-4gsiy1
Ths!

@nuo-promise
Copy link
Author

@jaywcjlove

@jaywcjlove
Copy link
Member

@nuo-promise
Copy link
Author

@nuo-promise https://codesandbox.io/embed/sad-mirzakhani-19i64b?fontsize=14&hidenavigation=1&theme=dark

deleted @codemirror/lang-javascript ....

Still handling style through createTheme is powerful! Ths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants