microsoft / monaco-editor

A browser based code editor
https://microsoft.github.io/monaco-editor/
MIT License
40.01k stars 3.57k forks source link

[Bug] Handlebars syntax highlighting broken since version 0.35.0 #4662

Open mpth opened 1 month ago

mpth commented 1 month ago

Reproducible in vscode.dev or in VS Code Desktop?

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

Playground with unexpected brackets highlighing {{{ }}} https://microsoft.github.io/monaco-editor/playground.html?source=v0.35.0#XQAAAAJ5AQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzhsWG_1uhs0-3YGTBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKicTKQ1OZgR4qMzYNG8oY_AkxFezfwWHwjDKVy3_uJ9AWb9KOwnA_ApXsDWPrV6CNfDprrH-007Gez0wm4FzXaZQQQ7y0Syg6uTw9urDuwR6z7WMtYEbZq2_Y9nbft1OLEbDqnwh8TKzjfDtcG6cBrapgfOLJ2AM045qGXGvaT6_jK4UWrD4WcDZwWEkMebOW9oCINNMYJFaITG8ntsjHU_zpJ9ooQK7LFjOlvNNin3V5UP_fQSIL

Monaco Editor Playground Code

const value = /* set from `myEditor.getModel()`: */ `

{{#blockHelper}}

{{ escaped }}

{{{ unescaped }}}

{{/blockHelper}}
`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
    value,
    language: "handlebars",
    automaticLayout: true,
});

Reproduction Steps

  1. Use handlebars tripple curly brackets for unescaped output
  2. Switch between editor version 0.34.1 (as expected) 0.35.0 and latest stable (not as expected)

Actual (Problematic) Behavior

image

Expected Behavior

image

Additional Context

In addition to the red coloring of the tripple curly brackets, you can also notice that brackets are colored in blue in general and not black as expected.