aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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