diff options
author | Robert Alessi <alessi@robertalessi.net> | 2018-05-13 10:10:44 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2018-05-13 10:10:44 +0200 |
commit | 5243297448992d442c3ad388a16b6cb44d83a4fc (patch) | |
tree | 5a0ebf874acab44f350031a596ebe8c1b90f8b17 | |
parent | df6151bda30990882694de21eaf59258fd436214 (diff) | |
download | arabluatex-5243297448992d442c3ad388a16b6cb44d83a4fc.tar.gz |
accept any command that is not \arb{} and has an optional argument
-rw-r--r-- | arabluatex.lua | 7 |
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 |
134 | end | 141 | end |
135 | 142 | ||