usage strings were not HTML-escaped properly (Eric)
This commit is contained in:
parent
8869cf4924
commit
754da6e8d8
|
@ -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)
|
||||
|
|
|
@ -96,7 +96,7 @@ return [==[
|
|||
<h3>Usage:</h3>
|
||||
<ul>
|
||||
# for usage in iter(module.usage) do
|
||||
$(li)<pre class="example">$(usage)</pre>$(il)
|
||||
$(li)<pre class="example">$(ldoc.escape(usage))</pre>$(il)
|
||||
# end -- for
|
||||
</ul>
|
||||
# end -- if usage
|
||||
|
@ -155,7 +155,7 @@ return [==[
|
|||
<h3>Usage:</h3>
|
||||
<ul>
|
||||
# for usage in iter(item.usage) do
|
||||
$(li)<pre class="example">$(usage)</pre>$(il)
|
||||
$(li)<pre class="example">$(ldoc.escape(usage))</pre>$(il)
|
||||
# end -- for
|
||||
</ul>
|
||||
# end -- if usage
|
||||
|
|
Loading…
Reference in New Issue