From f04b8a805875559fe3c1a541d451708e07d6f687 Mon Sep 17 00:00:00 2001 From: Frank Dana Date: Wed, 1 Mar 2023 17:39:58 -0500 Subject: [PATCH] Fix if*/elif* highlighting (#5) A regular expression with alternation will take the first match that succeeds, so if 'if' comes before 'ifarch', 'ifos', etc. then the longer matches will never even be checked. --- rpm-specfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm-specfile.js b/rpm-specfile.js index 8ed6f40..8242916 100644 --- a/rpm-specfile.js +++ b/rpm-specfile.js @@ -37,7 +37,7 @@ function hljsDefineRpmSpecfile(hljs) { }, { className: "link", - begin: /(%)(if|ifarch|ifnarch|ifos|ifnos|elif|elifarch|elifos|else|endif)/, + begin: /(%)(ifarch|ifnarch|ifos|ifnos|if|elifarch|elifos|elif|else|endif)/, }, { className: "link",