diff options
author | Norbert Preining <norbert@preining.info> | 2021-07-27 03:01:57 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-07-27 03:01:57 +0000 |
commit | cef58753eba8ad7e2071195dbd92454febe82d32 (patch) | |
tree | df909696e42fb25ce108e30258c7f935ded86079 /support/tex4ebook/tex4ebook-exec_epub.lua | |
parent | 84465d50d746dfed1bfbe7bb5065279665fa87de (diff) |
CTAN sync 202107270301
Diffstat (limited to 'support/tex4ebook/tex4ebook-exec_epub.lua')
-rw-r--r-- | support/tex4ebook/tex4ebook-exec_epub.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/support/tex4ebook/tex4ebook-exec_epub.lua b/support/tex4ebook/tex4ebook-exec_epub.lua index 75304e2494..539cf930ab 100644 --- a/support/tex4ebook/tex4ebook-exec_epub.lua +++ b/support/tex4ebook/tex4ebook-exec_epub.lua @@ -157,6 +157,10 @@ function make_opf() local id=table.concat(dir_part,"-")..fname.."_"..ext -- remove invalid characters from id start id = id:gsub("^[%.%-]*","") + -- remove colons + id = id:gsub(":", "_") + -- id cannot start by number, add trailing "x" character + id = id:gsub("^([%d])", "x%1") return "<item id='"..id .. "' href='"..item.."' media-type='"..mimetype.."' />",id end local find_all_files= function(s,r) @@ -277,9 +281,9 @@ function make_opf() end end local function find_zip() - if io.popen("zip -v","r"):close() then + if assert(io.popen("zip -v","r"):close()) then return "zip" - elseif io.popen("miktex-zip -v","r"):close() then + elseif assert(io.popen("miktex-zip -v","r"):close()) then return "miktex-zip" end log:warning "It appears you don't have zip command installed. I can't pack the ebook" |