diff options
Diffstat (limited to 'Master/texmf-dist/scripts/markdown/markdown-cli.lua')
-rw-r--r-- | Master/texmf-dist/scripts/markdown/markdown-cli.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Master/texmf-dist/scripts/markdown/markdown-cli.lua b/Master/texmf-dist/scripts/markdown/markdown-cli.lua index 6f6d10091b7..216cd187a1d 100644 --- a/Master/texmf-dist/scripts/markdown/markdown-cli.lua +++ b/Master/texmf-dist/scripts/markdown/markdown-cli.lua @@ -58,7 +58,7 @@ -- those in the standard .ins files. -- local metadata = { - version = "2.8.2", + version = "2.9.0", comment = "A module for the conversion from markdown to plain TeX", author = "John MacFarlane, Hans Hagen, Vít Novotný", copyright = {"2009-2016 John MacFarlane, Hans Hagen", @@ -68,6 +68,7 @@ local metadata = { local defaultOptions = {} defaultOptions.cacheDir = "." +defaultOptions.frozenCacheFileName = "frozenCache.tex" defaultOptions.blankBeforeBlockquote = false defaultOptions.blankBeforeCodeFence = false defaultOptions.blankBeforeHeading = false @@ -79,7 +80,9 @@ defaultOptions.contentBlocks = false defaultOptions.contentBlocksLanguageMap = "markdown-languages.json" defaultOptions.definitionLists = false defaultOptions.fencedCode = false +defaultOptions.finalizeCache = false defaultOptions.footnotes = false +defaultOptions.frozenCacheCounter = 0 defaultOptions.hashEnumerators = false defaultOptions.headerAttributes = false defaultOptions.html = false @@ -136,6 +139,8 @@ for i = 1, #arg do default_type = type(defaultOptions[key]) if default_type == "boolean" then options[key] = (value == "true") + elseif default_type == "number" then + options[key] = tonumber(value) else if default_type ~= "string" then if default_type == "nil" then @@ -170,9 +175,9 @@ end local input if input_filename then - local input_file = io.open(input_filename, "r") + local input_file = assert(io.open(input_filename, "r")) input = assert(input_file:read("*a")) - input_file:close() + assert(input_file:close()) else input = assert(io.read("*a")) end @@ -193,7 +198,7 @@ local convert = md.new(options) local output = convert(input:gsub("\r\n?", "\n") .. "\n") if output_filename then - local output_file = io.open(output_filename, "w") + local output_file = assert(io.open(output_filename, "w")) assert(output_file:write(output)) assert(output_file:close()) else |