aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2019-02-10 18:08:51 +0100
committerRobert Alessi <alessi@robertalessi.net>2019-02-10 18:08:51 +0100
commitf71307c441f923e722f5ce7f1019899763690e4b (patch)
treeb157e96957b3bcb085f8dcc7bad87c567ec1571d
parent01e4e7dfc1e1249aed51cd82c9b088efe4fd1272 (diff)
downloadarabluatex-f71307c441f923e722f5ce7f1019899763690e4b.tar.gz
improved preceding commit [01e4e7d]
-rw-r--r--arabluatex.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index 5449689..37e941e 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -1054,6 +1054,9 @@ function uc(str)
1054 body = string.sub(body, 2, -2) 1054 body = string.sub(body, 2, -2)
1055 return string.format("%s", body) 1055 return string.format("%s", body)
1056 end) 1056 end)
1057 str = string.gsub(str, "{", "\\@al@ob")
1058 str = string.gsub(str, "} ", "\\@al@cb@sp ")
1059 str = string.gsub(str, "}", "\\@al@cb")
1057 -- Allah and ibn 1060 -- Allah and ibn
1058 str = string.gsub(str, "(al%-lāh)([uai]?)", "{Allāh%2}") 1061 str = string.gsub(str, "(al%-lāh)([uai]?)", "{Allāh%2}")
1059 str = string.gsub(str, "([%'%-]?)(l%-lāh)([uai]?)", "%1{Llāh%3}") 1062 str = string.gsub(str, "([%'%-]?)(l%-lāh)([uai]?)", "%1{Llāh%3}")
@@ -1100,10 +1103,11 @@ function uc(str)
1100 for i = 1,#lcuc do 1103 for i = 1,#lcuc do
1101 str = string.gsub(str, "(%s[%(%<%[]?)"..lcuc[i].a, "%1"..lcuc[i].b) 1104 str = string.gsub(str, "(%s[%(%<%[]?)"..lcuc[i].a, "%1"..lcuc[i].b)
1102 end 1105 end
1103 str = gsub(str, -cmd * bcbraces, function(body) 1106 str = string.gsub(str, "{", "")
1104 body = string.sub(body, 2, -2) 1107 str = string.gsub(str, "}", "")
1105 return string.format("%s", body) 1108 str = string.gsub(str, "\\@al@ob", "{")
1106 end) 1109 str = string.gsub(str, "\\@al@cb@sp ", "} ")
1110 str = string.gsub(str, "\\@al@cb", "}")
1107 if export_utf == "yes" then 1111 if export_utf == "yes" then
1108 tofile = str 1112 tofile = str
1109 tooutfile(tofile) 1113 tooutfile(tofile)