aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2018-05-13 10:10:44 +0200
committerRobert Alessi <alessi@robertalessi.net>2018-05-13 10:10:44 +0200
commit5243297448992d442c3ad388a16b6cb44d83a4fc (patch)
tree5a0ebf874acab44f350031a596ebe8c1b90f8b17
parentdf6151bda30990882694de21eaf59258fd436214 (diff)
downloadarabluatex-5243297448992d442c3ad388a16b6cb44d83a4fc.tar.gz
accept any command that is not \arb{} and has an optional argument
-rw-r--r--arabluatex.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index 5e88b96..b2c651c 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -130,6 +130,13 @@ local function breakcmd(str)
130 body = string.sub(body, 2, -2) 130 body = string.sub(body, 2, -2)
131 return string.format("}\\%s{%s}\\arb{", tag, body) 131 return string.format("}\\%s{%s}\\arb{", tag, body)
132 end) 132 end)
133 -- any command that is not \arb{} and has an optional argument
134 str = string.gsub(str, "\\([^a][^r][^b].-)(%b[])(%b{})",
135 function(tag, opt, body)
136 opt = string.sub(opt, 2, -2)
137 body = string.sub(body, 2, -2)
138 return string.format("}\\%s[%s]{\\arb{%s}}\\arb{", tag, opt, body)
139 end)
133 return str 140 return str
134end 141end
135 142