aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2021-02-04 11:15:12 +0100
committerRobert Alessi <alessi@robertalessi.net>2021-02-04 11:15:12 +0100
commit285529a917236e78464c7f96a2229916c0d881c6 (patch)
treeec2557db17792908ff1b8215ee277a97b7dc2af3
parent6fb1fbb8c61436430a9a83a0e2232a263387f951 (diff)
downloadekdosis-285529a917236e78464c7f96a2229916c0d881c6.tar.gz
allow defined TeXtoTEIPats to be redefined
-rw-r--r--ekdosis.dtx12
1 files changed, 10 insertions, 2 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 1cd7d1b..77654f6 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -8235,8 +8235,16 @@ function ekdosis.newpatttotag(pat, repl)
8235 pat = string.gsub(pat, "([%[%]])", "%%%1") 8235 pat = string.gsub(pat, "([%[%]])", "%%%1")
8236 pat = string.gsub(pat, "%#[1-9]", "(.-)") 8236 pat = string.gsub(pat, "%#[1-9]", "(.-)")
8237 repl = string.gsub(repl, "%#([1-9])", "%%%1") 8237 repl = string.gsub(repl, "%#([1-9])", "%%%1")
8238 table.insert(texpatttotags, { a = pat, b = repl }) 8238 if isintable(texpatttotags, pat)
8239 table.sort(texpatttotags, function(a ,b) return(#a.a > #b.a) end) 8239 then
8240 local index = get_a_index(pat, texpatttotags)
8241 table.remove(texpatttotags, index)
8242 table.insert(texpatttotags, { a = pat, b = repl })
8243 table.sort(texpatttotags, function(a ,b) return(#a.a > #b.a) end)
8244 else
8245 table.insert(texpatttotags, { a = pat, b = repl })
8246 table.sort(texpatttotags, function(a ,b) return(#a.a > #b.a) end)
8247 end
8240 return true 8248 return true
8241end 8249end
8242 8250