From f947d5490236ab8e7e4f40efccc2697d974fae60 Mon Sep 17 00:00:00 2001 From: Frank Dana Date: Thu, 14 Apr 2022 07:14:06 -0400 Subject: [PATCH] Fix if*/elif* highlighting 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 6d5e5e6..6dd3cdc 100644 --- a/rpm-specfile.js +++ b/rpm-specfile.js @@ -36,7 +36,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",