diff options
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/filters/make4ht-fixligatures.lua')
-rw-r--r-- | Master/texmf-dist/scripts/make4ht/filters/make4ht-fixligatures.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/filters/make4ht-fixligatures.lua b/Master/texmf-dist/scripts/make4ht/filters/make4ht-fixligatures.lua new file mode 100644 index 00000000000..01b31ed3067 --- /dev/null +++ b/Master/texmf-dist/scripts/make4ht/filters/make4ht-fixligatures.lua @@ -0,0 +1,16 @@ +-- fix ligatures +-- replace ligatures produced by tex4ht with their components +-- this prevents problems with some readers +local gsub = unicode.utf8.gsub +function filter(s) + local replaces = { + ["fi"] = "fi", + ["ffi"] = "ffi", + ["fl"] = "fl", + ["ffl"] = "ffl", + ["ff"] = "ff" + } + return gsub(s, "([fiffiflfflff])",function (x) return replaces[x] or x end) +end + +return filter |