aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2017-07-02 12:48:11 +0200
committerRobert Alessi <alessi@robertalessi.net>2017-07-02 12:48:11 +0200
commit158fe0112d27917ae9f7f91bc8aab1dd23d429ea (patch)
tree4e14e2031059522bab9e92b039ccde5c16ff03d8
parent46b1e28b3d4eafb22c41710aa0c0523409d7b03b (diff)
downloadarabluatex-158fe0112d27917ae9f7f91bc8aab1dd23d429ea.tar.gz
new lua function 'isintable()', newtable 'breakcmds'
-rw-r--r--arabluatex.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index 9252127..3a405a2 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -27,6 +27,13 @@ require("arabluatex_fullvoc")
27require("arabluatex_novoc") 27require("arabluatex_novoc")
28require("arabluatex_trans") 28require("arabluatex_trans")
29 29
30function isintable(table, value)
31 for _, v in pairs(table) do
32 if v == value then return true end
33 end
34 return false
35end
36
30local function protectarb(str) 37local function protectarb(str)
31 str = string.gsub(str, "(\\arb.?)(%[.-%])(%b{})", "\\@arb%2%3") 38 str = string.gsub(str, "(\\arb.?)(%[.-%])(%b{})", "\\@arb%2%3")
32 str = string.gsub(str, "(\\begin.?)(%b{})(%b[])", "\\@begin%3%2") 39 str = string.gsub(str, "(\\begin.?)(%b{})(%b[])", "\\@begin%3%2")
@@ -46,6 +53,8 @@ local function unprotectarb(str)
46return str 53return str
47end 54end
48 55
56breakcmds = {}
57
49local function breakcmd(str) 58local function breakcmd(str)
50 -- process \item[], then \item[] 59 -- process \item[], then \item[]
51 str = string.gsub(str, "\\(item.?)(%b[])", 60 str = string.gsub(str, "\\(item.?)(%b[])",