Microsoft/monaco-editor

[Bug] Wrong syntax highlighting for reStructuredText

Open

#3.113 geöffnet am 20. Mai 2022

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.283 Forks)batch import
bughelp wantedtokenization

Repository-Metriken

Stars
 (14.836 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6h 26m) (15 gemergte PRs in 30 T)

Beschreibung

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

.. math::

.. hello:: asd

.. line-block::

.. line-block:: aaa

.. lineQ-block:: aa
.. lineQQ-block:: aa
.. lineQQQ-block:: aa
.. lineQQQQ-block:: aa

.. lineblock:: aaa

    .. line-block::

Actual Behavior

Half of directives in the example code are treated as comments:

Выделение_159

Expected Behavior

All rst directives in the example code should be successfully determined by tokenizer.

Выделение_157

According to https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#directives:

Directive types are case-insensitive single words (alphanumerics plus isolated internal hyphens, underscores, plus signs, colons, and periods; no whitespace)

Also note that directive arguments are optional, thus a whitespace after "::" is optional too.

Additional Context

No response

Contributor Guide