Remove trailing newlines from output

If in yaml, the output field is folded-style aka:

output: <
   some multi-line
   output here

The unfolded string will have a trailing newline. Remove it.
This commit is contained in:
Mark Stemm
2017-08-09 17:53:53 -07:00
parent 9d6fe878e1
commit ebed9f8dfd
3 changed files with 6 additions and 0 deletions

View File

@@ -127,6 +127,7 @@ function trim(s)
if (type(s) ~= "string") then return s end
return (s:gsub("^%s*(.-)%s*$", "%1"))
end
parser.trim = trim
local function terminal (tag)
-- Rather than trim the whitespace in this way, it would be nicer to exclude it from the capture...