escape <> for HTML; uniform 14em navbar; uppercase C
steve donovan
9 years ago
46 | 46 |
label = label:gsub('_','\\_')
|
47 | 47 |
end
|
48 | 48 |
local html = ldoc.href(ref) or '#'
|
49 | |
label = label or qname
|
|
49 |
label = ldoc.escape(label or qname)
|
50 | 50 |
local res = ('<a href="%s">%s</a>'):format(html,label)
|
51 | 51 |
return res
|
52 | 52 |
end))
|
|
57 | 57 |
if name and do_escape then
|
58 | 58 |
label = name:gsub('_', '\\_')
|
59 | 59 |
end
|
|
60 |
label = ldoc.escape(label)
|
60 | 61 |
if ref then
|
61 | 62 |
return ('<a href="%s">%s</a>'):format(ldoc.href(ref),label)
|
62 | 63 |
else
|
23 | 23 |
|
24 | 24 |
local spans = {keyword=true,number=true,string=true,comment=true,global=true,backtick=true}
|
25 | 25 |
|
26 | |
local cpp_lang = {c = true, cpp = true, cxx = true, h = true}
|
|
26 |
local cpp_lang = {C = true, c = true, cpp = true, cxx = true, h = true}
|
27 | 27 |
|
28 | 28 |
function prettify.lua (lang, fname, code, initial_lineno, pre, linenos)
|
29 | 29 |
local res, lexer, tokenizer = List(), require 'ldoc.lexer'
|