You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with syntax highlighting in case of Markdown files:
Continuation lines of list elements are highlighted as if they were code blocks, if the indentation is 4 spaces (3 spaces between the - and the text), or one tab:
List:
- item1
- item2
continuation of item2
paragraph, still part of the list item2
Not part of list.
Monarch's language syntax definition for Markdown contains a rule for code blocks that renders indented lines (4 spaces or a tab) as string:
[
// list (starting with * or number)
[/^\s*([\*\-+:]|\d+\.)\s/, 'keyword'],
// code block (4 spaces indent)
[/^(\t|[ ]{4})[^ ].*$/, 'string']
]
This also explains why the effect is visible only if the indentation of the continuation lines is exactly 4 spaces or 1 tab, not if it is e.g. 3 spaces. Perhaps the grammar for lists would need to be more complex. Lists can also contain sub elements such as paragraphs, tables, code blocks and nested lists etc.
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Link
https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.2#XQAAAAKiAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzwauRgmSaumWUF-TBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKihpSJZPgox8F4oW2m8J9KFw9qZvHqyprjcG0VSNk0LOjyrVa5ikwVDlGr-NibjN81Sv0qZtUJK-NhABGuhXGrUc_yjxpWm50luejDZ7T7BSnRqO7ZbC94w-ednXHeVtLBHEPsg4q99lYm-6ylvbElZl6ZR0jjH7_6HllAwXXHEiW3mrpiyJCdj5IyePrkvuUsw0O-7ryGNyj6VaD3nx4dESXVRAnRtItkQuEuyZGs_qUA6eu8n76CB_mAZ4-zEZVya_3bUyQuFKPzVqr5w6ZAM7-veK3
Monaco Editor Playground Code
Reproduction Steps
No response
Actual (Problematic) Behavior
There is an issue with syntax highlighting in case of Markdown files:
Continuation lines of list elements are highlighted as if they were code blocks, if the indentation is 4 spaces (3 spaces between the - and the text), or one tab:
In the Language Editor within the Monaco-Editor of the Monarch documention this is displayed as:
Monarch's language syntax definition for Markdown contains a rule for code blocks that renders indented lines (4 spaces or a tab) as string:
This also explains why the effect is visible only if the indentation of the continuation lines is exactly 4 spaces or 1 tab, not if it is e.g. 3 spaces. Perhaps the grammar for lists would need to be more complex.
Lists can also contain sub elements such as paragraphs, tables, code blocks and nested lists etc.
Relates to: #2489
Expected Behavior
No response
Additional Context
monaco-editor version: 0.52.2
The text was updated successfully, but these errors were encountered: