diff --git a/ldoc/html.lua b/ldoc/html.lua index beee74b..d78a170 100644 --- a/ldoc/html.lua +++ b/ldoc/html.lua @@ -34,9 +34,14 @@ local function cleanup_whitespaces(text) return table.concat(lines, "\n") end +local escape_table = { ["'"] = "'", ["\""] = """, ["<"] = "<", [">"] = ">", ["&"] = "&" } + function html.generate_output(ldoc, args, project) local check_directory, check_file, writefile = tools.check_directory, tools.check_file, tools.writefile + function ldoc.escape(str) + return (str:gsub("['&<>\"]", escape_table)) + end -- this generates the internal module/function references function ldoc.href(see) diff --git a/ldoc/html/ldoc_ltp.lua b/ldoc/html/ldoc_ltp.lua index cf1e2eb..a9fc310 100644 --- a/ldoc/html/ldoc_ltp.lua +++ b/ldoc/html/ldoc_ltp.lua @@ -96,7 +96,7 @@ return [==[

Usage:

# end -- if usage @@ -155,7 +155,7 @@ return [==[

Usage:

# end -- if usage