diff options
author | Robert Alessi <alessi@robertalessi.net> | 2017-07-02 12:48:11 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2017-07-02 12:48:11 +0200 |
commit | 158fe0112d27917ae9f7f91bc8aab1dd23d429ea (patch) | |
tree | 4e14e2031059522bab9e92b039ccde5c16ff03d8 | |
parent | 46b1e28b3d4eafb22c41710aa0c0523409d7b03b (diff) | |
download | arabluatex-158fe0112d27917ae9f7f91bc8aab1dd23d429ea.tar.gz |
new lua function 'isintable()', newtable 'breakcmds'
-rw-r--r-- | arabluatex.lua | 9 |
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") | |||
27 | require("arabluatex_novoc") | 27 | require("arabluatex_novoc") |
28 | require("arabluatex_trans") | 28 | require("arabluatex_trans") |
29 | 29 | ||
30 | function isintable(table, value) | ||
31 | for _, v in pairs(table) do | ||
32 | if v == value then return true end | ||
33 | end | ||
34 | return false | ||
35 | end | ||
36 | |||
30 | local function protectarb(str) | 37 | local 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) | |||
46 | return str | 53 | return str |
47 | end | 54 | end |
48 | 55 | ||
56 | breakcmds = {} | ||
57 | |||
49 | local function breakcmd(str) | 58 | local 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[])", |