From 158fe0112d27917ae9f7f91bc8aab1dd23d429ea Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 2 Jul 2017 12:48:11 +0200 Subject: new lua function 'isintable()', newtable 'breakcmds' --- arabluatex.lua | 9 +++++++++ 1 file changed, 9 insertions(+) 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") require("arabluatex_novoc") require("arabluatex_trans") +function isintable(table, value) + for _, v in pairs(table) do + if v == value then return true end + end + return false +end + local function protectarb(str) str = string.gsub(str, "(\\arb.?)(%[.-%])(%b{})", "\\@arb%2%3") str = string.gsub(str, "(\\begin.?)(%b{})(%b[])", "\\@begin%3%2") @@ -46,6 +53,8 @@ local function unprotectarb(str) return str end +breakcmds = {} + local function breakcmd(str) -- process \item[], then \item[] str = string.gsub(str, "\\(item.?)(%b[])", -- cgit v1.2.3