Merge pull request #149 from vanzomerenc/master

Resolve issue #22 'In-line links with underscores are broken'
This commit is contained in:
Steve J Donovan 2014-01-07 01:19:37 -08:00
commit a8c4d9fa1e
1 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,9 @@ local function resolve_inline_references (ldoc, txt, item, plain)
res = res:gsub('`([^`]+)`',function(name)
local ref,err = markup.process_reference(name)
if ref then
if not plain and name then
name = name:gsub('_', '\\_')
end
return ('<a href="%s">%s</a> '):format(ldoc.href(ref),name)
else
return '<code>'..name..'</code>'