diff options
Diffstat (limited to 'support/make4ht/filters/make4ht-cleanspan-nat.lua')
-rw-r--r-- | support/make4ht/filters/make4ht-cleanspan-nat.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/support/make4ht/filters/make4ht-cleanspan-nat.lua b/support/make4ht/filters/make4ht-cleanspan-nat.lua new file mode 100644 index 0000000000..896132160c --- /dev/null +++ b/support/make4ht/filters/make4ht-cleanspan-nat.lua @@ -0,0 +1,12 @@ +-- cleanspan function submitted by Nat Kuhn +-- http://www.natkuhn.com/ + +local function filter(s) + local pattern = "(<span%s+([^>]+)>[^<]*)</span>(%s*)<span%s+%2>" + repeat + s, n = s:gsub(pattern, "%1%3") + until n == 0 + return s +end + +return filter |