diff options
Diffstat (limited to 'arabluatex.lua')
-rw-r--r-- | arabluatex.lua | 16 |
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 |
129 | end | 129 | end |
130 | 130 | ||
131 | local 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 | ||
144 | end | ||
145 | |||
131 | local function takeoutabjad(str) | 146 | local 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 | ||
544 | function processtrans(str, mode, rules, scheme) | 559 | function 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) |