issue #172 spurious space; still cleaning out tab infestation

This commit is contained in:
steve donovan 2014-10-13 19:38:11 +02:00
parent 31ee8f5cbc
commit 2639ddec9f
2 changed files with 13 additions and 14 deletions

View File

@ -58,7 +58,7 @@ local function resolve_inline_references (ldoc, txt, item, plain)
if name and do_escape then
name = name:gsub('_', '\\_')
end
return ('<a href="%s">%s</a> '):format(ldoc.href(ref),name)
return ('<a href="%s">%s</a>'):format(ldoc.href(ref),name)
else
return '<code>'..name..'</code>'
end
@ -246,16 +246,16 @@ local function get_formatter(format)
local used_format = format
local formatter = (formatters[format] or generic_formatter)(format)
if not formatter then -- try another equivalent processor
for name, f in pairs(formatters) do
formatter = f(name)
if formatter then
print('format: '..format..' not found, using '..name)
used_format = name
break
end
end
end
return formatter, used_format
for name, f in pairs(formatters) do
formatter = f(name)
if formatter then
print('format: '..format..' not found, using '..name)
used_format = name
break
end
end
end
return formatter, used_format
end
local function text_processor(ldoc)
@ -368,5 +368,4 @@ function markup.create (ldoc, format, pretty)
return processor
end
return markup

View File

@ -29,7 +29,7 @@ local cpp_lang = {c = true, cpp = true, cxx = true, h = true}
function prettify.lua (lang, fname, code, initial_lineno, pre, linenos)
local res, lexer, tokenizer = List(), require 'ldoc.lexer'
local tnext = lexer.skipws
local ik = 1
local ik = 1
if not cpp_lang[lang] then
tokenizer = lexer.lua
else
@ -52,7 +52,7 @@ function prettify.lua (lang, fname, code, initial_lineno, pre, linenos)
while t do
val = escape(val)
if linenos and tok:lineno() == linenos[ik] then
res:append('<a id="'..linenos[ik]..'"></a>')
res:append('<a id="'..linenos[ik]..'"></a>')
ik = ik + 1
end
if globals.functions[val] or globals.tables[val] then