Hello! Thank you very much for providing such an excellent editor!
In markdown mode. I highlighted the code block, but I found that when I write comments and the comments are in Chinese, there is an infinite recursion bug (the console did not report an error). First of all, look at the situation of the problem, the following is the GIF picture I recorded, and then I will post the code below
I try to find out the cause of the problem. Finally, I found the problem of highlighting comments. When I delete the highlighted comments, there is no such problem. But when I add the highlighted comments again, this problem will appear again
Here is my simple code
// theme.js
import { HighlightStyle, tags } from '@codemirror/highlight';
export default () => {
return HighlightStyle.define([
...(other hightlight tag colors),
// There is a problem with this.
// When I delete it below, the editor works normally.
{
tag: tags.comment,
color: '#6a9955'
},
])
}
// initCodeMirror.js
import theme from './theme'; // ↑↑↑ look top theme.js
EditorState.create({
extensions: [
theme(), // ↑↑↑ look top theme.js
markdown({
base: markdownLanguage,
codeLanguages: languages
}),
]
})