From b6b3e0a0db7de1a00a0cceb3b88ecf2b9a020141 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 16 Dec 2019 17:28:57 +0100 Subject: [PATCH] Fixes microsoft/monaco-editor#1123 --- src/handlebars/handlebars.test.ts | 12 ++++++++++++ src/handlebars/handlebars.ts | 1 + 2 files changed, 13 insertions(+) diff --git a/src/handlebars/handlebars.test.ts b/src/handlebars/handlebars.test.ts index 21dacb6e..4e5aa2bd 100644 --- a/src/handlebars/handlebars.test.ts +++ b/src/handlebars/handlebars.test.ts @@ -269,5 +269,17 @@ testTokenization(['handlebars', 'css'], [ { startIndex: 8, type: 'attribute.value' }, { startIndex: 30, type: 'delimiter.html' } ] + }], + + [{ + line: '{{test "coloring/looks broken"}}">', + tokens: [ + { startIndex: 0, type: 'delimiter.handlebars' }, + { startIndex: 2, type: 'variable.parameter.handlebars' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'string.handlebars' }, + { startIndex: 30, type: 'delimiter.handlebars' }, + { startIndex: 32, type: '' } + ] }] ]); diff --git a/src/handlebars/handlebars.ts b/src/handlebars/handlebars.ts index e1efbb3b..dc1eee51 100644 --- a/src/handlebars/handlebars.ts +++ b/src/handlebars/handlebars.ts @@ -220,6 +220,7 @@ export const language = { ], handlebarsRoot: [ + [/"[^"]*"/, 'string.handlebars'], [/[#/][^\s}]+/, 'keyword.helper.handlebars'], [/else\b/, 'keyword.helper.handlebars'], [/[\s]+/],