diff options
author | Norbert Preining <norbert@preining.info> | 2020-01-24 03:00:54 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-01-24 03:00:54 +0000 |
commit | e1192611f0655a1ccaff0dff2f53c7c65fa5db07 (patch) | |
tree | 232f5be17a2221a57cc6515bfe8692772b3a3e89 /support/make4ht/make4ht-odtfilter.lua | |
parent | f7e5d81fe9880913485f7f8c541eeca7adf4c195 (diff) |
CTAN sync 202001240300
Diffstat (limited to 'support/make4ht/make4ht-odtfilter.lua')
-rw-r--r-- | support/make4ht/make4ht-odtfilter.lua | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/support/make4ht/make4ht-odtfilter.lua b/support/make4ht/make4ht-odtfilter.lua deleted file mode 100644 index 97f0b8df67..0000000000 --- a/support/make4ht/make4ht-odtfilter.lua +++ /dev/null @@ -1,33 +0,0 @@ -local mkutils = require "mkutils" -local zip = require "zip" - - --- use function to change contents of the ODT file -local function update_odt(odtfilename, file_path, fn) - -- get name of the odt file - local odtname = mkutils.remove_extension(odtfilename) .. ".odt" - -- open and read contents of the requested file inside ODT file - local odtfile = zip.open(odtname) - local local_file = odtfile:open(file_path) - local content = local_file:read("*all") - local_file:close() - odtfile:close() - -- update the content using user function - content = fn(content) - -- write the updated file - local local_file_file = io.open(file_path,"w") - local_file_file:write(content) - local_file_file:close() - os.execute("zip " .. odtname .. " " .. file_path) - os.remove(file_path) -end - -Make:match("tmp$", function(name, par) - update_odt(name, "content.xml", function(content) - return content:gsub("%&%#x([A-Fa-f0-9]+);", function(entity) - -- convert hexadecimal entity to Unicode - print(entity,utfchar(tonumber(entity, 16))) - return utfchar(tonumber(entity, 16)) - end) - end) -end) |