Microsoft/monaco-editor

Wrong YAML syntax highlighting

Open

#2681 aperta il 4 ott 2021

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)JavaScript (1283 fork)batch import
buggrammarshelp wanted

Metriche repository

Star
 (14.836 star)
Metriche merge PR
 (Merge medio 6h 26m) (15 PR mergiate in 30 g)

Descrizione

There seem to be some wrong syntax highlighting when for example entering foo: "{bar: 7}". Monaco highlights {bar the same way as foo. It should better respect that it is part of a string value. Just tested the same with VS Code and it doesn't have this problem.

monaco-editor version: 0.28.0 Browser: tested in Chrome OS: Windows 10 Playground code that reproduces the issue:

monaco.editor.create(document.getElementById("container"), {
    value: 'foo: "{bar: 7}"\n',
    language: 'yaml'
});

Guida contributor