From 4b69174533e7684347410163acf23c08434a42f8 Mon Sep 17 00:00:00 2001 From: Francesco Paolo Severino Date: Mon, 28 Apr 2025 20:29:41 +0200 Subject: [PATCH 1/4] Fix bug in Leaf keyword highlighting --- src/languages/leaf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/leaf.js b/src/languages/leaf.js index a430d0331e..7ae6d86ee1 100644 --- a/src/languages/leaf.js +++ b/src/languages/leaf.js @@ -26,7 +26,7 @@ export default function(hljs) { }, { scope: 'keyword', - match: LITERALS.join("|"), + match: LITERALS.map(lit => `\\b${lit}\\b`).join("|"), }, { scope: 'variable', From 87467c1717fc37dc793f8715555721ad2854ac47 Mon Sep 17 00:00:00 2001 From: Francesco Paolo Severino <96546612+fpseverino@users.noreply.github.com> Date: Sun, 11 May 2025 20:25:39 +0200 Subject: [PATCH 2/4] Update CHANGES.md --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 5c5978a3c5..d1e91e507c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Core Grammars: - fix(ex) adds support for `?'` char literal and missing `defguardp` keyword [Kevin Bloch][] - fix(diff) fix unified diff hunk header regex to allow unpaired numbers [Chris Wilson][] - enh(php) support single line and hash comments in attributes, constructor and functions [Antoine Musso][] +- fix(leaf) fix bug in Leaf keyword highlighting [Francesco Paolo Severino][] CONTRIBUTORS @@ -23,6 +24,7 @@ CONTRIBUTORS [Chris Wilson]: https://github.com/sushicw [Antoine Musso]: https://github.com/hashar [Chester Moses]: https://github.com/Chester-Moses-HCL +[Francesco Paolo Severino]: https://github.com/fpseverino ## Version 11.11.1 From e50c9354730ce92199bf0adabe69f56b32ed588a Mon Sep 17 00:00:00 2001 From: Francesco Paolo Severino <96546612+fpseverino@users.noreply.github.com> Date: Sun, 11 May 2025 20:31:38 +0200 Subject: [PATCH 3/4] Update default.txt --- test/markup/leaf/default.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/markup/leaf/default.txt b/test/markup/leaf/default.txt index 3b643511ba..60dd953179 100644 --- a/test/markup/leaf/default.txt +++ b/test/markup/leaf/default.txt @@ -7,7 +7,7 @@ #if(count(visit) == 1): Hello new user! -#elseif(title == "Welcome back!"): +#elseif(index == "Welcome back!"): Hello old user #else: Unexpected page! From 876dd86d22f7eac72d6c36370d3d7e3ac7226d5d Mon Sep 17 00:00:00 2001 From: Francesco Paolo Severino <96546612+fpseverino@users.noreply.github.com> Date: Sun, 11 May 2025 20:31:55 +0200 Subject: [PATCH 4/4] Update default.expect.txt --- test/markup/leaf/default.expect.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/markup/leaf/default.expect.txt b/test/markup/leaf/default.expect.txt index 17d6db847e..bea28ee4f6 100644 --- a/test/markup/leaf/default.expect.txt +++ b/test/markup/leaf/default.expect.txt @@ -7,7 +7,7 @@ #if(count(visit) == 1): Hello new user! -#elseif(title == "Welcome back!"): +#elseif(index == "Welcome back!"): Hello old user #else: Unexpected page!