squashed trailing space problem with section titles; allowing numbers in links

This commit is contained in:
steve donovan 2013-03-28 13:06:42 +02:00
parent 158aa9ff14
commit 897061ac17
2 changed files with 5 additions and 2 deletions

View File

@ -346,7 +346,7 @@ end
-- is not empty. -- is not empty.
function File:add_document_section(title) function File:add_document_section(title)
local section = title:gsub('%A','_') local section = title:gsub('%W','_')
self:new_item { self:new_item {
name = section, name = section,
class = 'section', class = 'section',

View File

@ -122,7 +122,10 @@ function html.generate_output(ldoc, args, project)
else return name end else return name end
end end
function ldoc.no_spaces(s) return (s:gsub('%A','_')) end function ldoc.no_spaces(s)
s = s:gsub('%s*$','')
return (s:gsub('%W','_'))
end
function ldoc.titlecase(s) function ldoc.titlecase(s)
return (s:gsub('(%a)(%a*)',function(f,r) return (s:gsub('(%a)(%a*)',function(f,r)