Adding either a backtick code span or a literal sequence of backticks.
# Attempt to parse backticks
#
# Adding either a backtick code span or a literal sequence of backticks.
private fun parse_backticks: Bool do
var column_before = column
var ticks = match(re_ticks_here)
if ticks == null then return false
var after_open_ticks = index
var matched = match(re_ticks)
while matched != null do
if matched == ticks then
var content = input.substring(after_open_ticks, index - after_open_ticks - ticks.length)
content = content.trim
content = content.replace(re_whitespace, " ")
var node = new MdCode(new MdLocation(line, column_before, line, column), matched.to_s, content.trim)
append_node(node)
column += 1
return true
end
matched = match(re_ticks)
end
# If we got here, we didn't match a closing backtick sequence
index = after_open_ticks
column = after_open_ticks + 1
append_text(ticks)
return true
end
lib/markdown2/markdown_inline_parsing.nit:402,2--429,4