aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'arabluatex.lua')
-rw-r--r--arabluatex.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index 07968c0..527be3b 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -128,6 +128,21 @@ local function indnum(str)
128 return str 128 return str
129end 129end
130 130
131local function processarbnull(str, scheme)
132 if scheme == "buckwalter" then
133 str = string.gsub(str, "(\\arbnull.?)(%b{})", function(tag, body)
134 body = string.sub(body, 2, -2)
135 return string.format("P%sP", body)
136 end)
137 else
138 str = string.gsub(str, "(\\arbnull.?)(%b{})", function(tag, body)
139 body = string.sub(body, 2, -2)
140 return string.format("o%so", body)
141 end)
142 end
143 return str
144end
145
131local function takeoutabjad(str) 146local function takeoutabjad(str)
132 str = string.gsub(str, "(\\abjad.?)(%b{})", function(tag, body) 147 str = string.gsub(str, "(\\abjad.?)(%b{})", function(tag, body)
133 body = string.sub(body, 2, -2) 148 body = string.sub(body, 2, -2)
@@ -543,6 +558,7 @@ end
543 558
544function processtrans(str, mode, rules, scheme) 559function processtrans(str, mode, rules, scheme)
545 str = "\\arb{".. str.."}" 560 str = "\\arb{".. str.."}"
561 str = processarbnull(str, scheme)
546 str = takeoutabjad(str) 562 str = takeoutabjad(str)
547 str = protectarb(str) 563 str = protectarb(str)
548 str = breakcmd(str) 564 str = breakcmd(str)