diff options
-rw-r--r-- | mod/tex/context/third/rst/rst_parser.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mod/tex/context/third/rst/rst_parser.lua b/mod/tex/context/third/rst/rst_parser.lua index ab391b1..eeaa5fd 100644 --- a/mod/tex/context/third/rst/rst_parser.lua +++ b/mod/tex/context/third/rst/rst_parser.lua @@ -26,6 +26,7 @@ local optional_setups = thirddata.rst_setups rst.strip_BOM = false rst.expandtab = false rst.shiftwidth = 4 +rst.crlf = true helpers.rst_debug = false local iowrite = io.write @@ -1397,6 +1398,13 @@ function file_helpers.insert_blank (raw) return raw end +function file_helpers.crlf (raw) + if raw:find"\r\n" then + return raw:gsub("\r\n", "\n") + end + return raw +end + local function load_file (name) f = assert(io.open(name, "r"), "Not a file!") if not f then return 1 end @@ -1407,6 +1415,9 @@ local function load_file (name) if thirddata.rst.strip_BOM then tmp = fh.strip_BOM(tmp) end + if thirddata.rst.crlf then + tmp = fh.crlf(tmp) + end if thirddata.rst.expandtab then tmp = fh.expandtab(tmp) end |