erosman / CodeMirror-plus

Additonal features for CodeMirror
Mozilla Public License 2.0
10 stars 2 forks source link

Keywords In Double Quotes #3

Closed jinghaihan closed 1 year ago

jinghaihan commented 1 year ago

When the keyword appears in single quotation marks, it is normally added with "cm string", but when it appears in double quotation marks, its class name is "cm keyword"

Is there any good solution?

erosman commented 1 year ago

Can you post an example?

erosman commented 1 year ago

As in your image, that is how CodeMirror processes them.

I meant, keywords in the config e.g.

const editor = CodeMirror(document.body, {
  lineNumbers: true,
  mode:  "javascript",
  keyword: {
    "word1": "style1",
    "word2": "style1",
    "word3": "style1",
    "example\.com": "style2",
    "abc\\d+": "style2"
  }
});
erosman commented 1 year ago

That might be the case in CodeMirror. You can ask codemirror5.