markdown :: TokenHTML :: check_html
Also take care of link and mailto shortcuts.
# Is the HTML valid?
# Also take care of link and mailto shortcuts.
private fun check_html(v: MarkdownProcessor, out: FlatBuffer, md: Text, start: Int): Int do
# check for auto links
var tmp = new FlatBuffer
var pos = md.read_until(tmp, start + 1, ':', ' ', '>', '\n')
if pos != -1 and md[pos] == ':' and tmp.is_link_prefix then
pos = md.read_until(tmp, pos, '>')
if pos != -1 then
var link = tmp.write_to_string
v.decorator.add_link(v, link, link, null)
return pos
end
end
# TODO check for mailto
# check for inline html
if start + 2 < md.length then
return md.read_xml(out, start, true)
end
return -1
end
lib/markdown/markdown.nit:2227,2--2247,4