aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2019-11-04 11:19:55 +0100
committerRobert Alessi <alessi@robertalessi.net>2019-11-04 11:19:55 +0100
commitb426dbd31ff927ad167fe4e6fcf0ba5c28ce39fc (patch)
tree8c49f42db6efd121e2310383eb5e699d17fd80ca
parentea8e504bc4e355c65c85bbebf3eec69424b95b28 (diff)
downloadekdosis-b426dbd31ff927ad167fe4e6fcf0ba5c28ce39fc.tar.gz
escaped square brackets in ekdosis.newpatttotag()
-rw-r--r--ekdosis.dtx5
1 files changed, 3 insertions, 2 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 71d68d2..d92dcd5 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -1049,7 +1049,7 @@ idno={}, msName={}, origDate={}][3]{%
1049%<*lua> 1049%<*lua>
1050% \fi 1050% \fi
1051% \begin{ekdlua} 1051% \begin{ekdlua}
1052 1052-- `'
1053-- This table will hold the functions: 1053-- This table will hold the functions:
1054ekdosis = {} 1054ekdosis = {}
1055 1055
@@ -1321,8 +1321,9 @@ function ekdosis.newcmdtotag(cmd, tag, attr)
1321end 1321end
1322 1322
1323function ekdosis.newpatttotag(pat, repl) 1323function ekdosis.newpatttotag(pat, repl)
1324 pat = string.gsub(pat, "([%[%]])", "%%%1")
1324 pat = string.gsub(pat, "%#[1-9]", "(.-)") 1325 pat = string.gsub(pat, "%#[1-9]", "(.-)")
1325 repl = string.gsub(repl, "%#", "%%") 1326 repl = string.gsub(repl, "%#([1-9])", "%%%1")
1326 table.insert(texpatttotags, { a = pat, b = repl }) 1327 table.insert(texpatttotags, { a = pat, b = repl })
1327 return true 1328 return true
1328end 1329end