plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

XML syntax highlight broken in some places #541

Open boghyon opened 3 years ago

boghyon commented 3 years ago

To Reproduce Steps to reproduce the behavior:

  1. Go to https://embed.plnkr.co/7txzTsNwOBDbyi87/?show=view/Home.view.xml
  2. Observe how the syntax highlighting gets broken if the attribute value consists of multiple lines.

Expected behavior The attribute values should be all in the same color (e.g. blue) but they're not due to being multi-line. Only single-lined values are all blue.

Screenshots plunk-xml-code-editor-screenshot

Additional context Does Plunker come with its own code editor?
In Ace, for example, I cannot reproduce the issue: ace-editor-xml

In case the editor is using Google's Prettify somehow, there is a known issue with handling XML: https://github.com/googlearchive/code-prettify/issues/563

ggoodman commented 3 years ago

Hi @boghyon this will remain an issue as long as Plunker uses monaco-editor built-in syntax highlighting system based on monarch. The monarch-based syntax highlighting has well-known limitations due to its simplicity. In vscode, syntax-highlighting is done using textmate grammars.

It is possible to port this more sophisticated highlighting to the browser using vscode-onigurama but it is not something I've yet attempted.