Windows line endings led to wrong section names in Markdown documents
This commit is contained in:
parent
04da31d5c7
commit
f3e5a5a576
|
@ -90,6 +90,8 @@ function markup.add_sections(F, txt)
|
|||
end
|
||||
local title = line:match (title_pat)
|
||||
if title then
|
||||
--- Windows line endings are the cockroaches of text
|
||||
title = title:gsub('\r$','')
|
||||
-- Markdown allows trailing '#'...
|
||||
title = title:gsub('%s*#+$','')
|
||||
sections[L] = F:add_document_section(lstrip(title))
|
||||
|
|
Loading…
Reference in New Issue