MarkdownEmitter::decorator
.
redef fun emit(v) do
var current_text = v.current_text.as(not null)
var a = pos + next_pos + 1
var b = v.find_token(current_text, a, self)
if b > 0 then
v.current_pos = b + next_pos
while a < b and current_text[a] == ' ' do a += 1
if a < b then
while current_text[b - 1] == ' ' do b -= 1
v.decorator.add_span_code(v, current_text, a, b)
end
else
v.addc char
end
end
lib/markdown/markdown.nit:2036,2--2050,4
redef fun emit(v) do
var tmp = new FlatBuffer
var b = check_link(v, tmp, pos, self)
if b > 0 then
emit_hyper(v)
v.current_pos = b
else
v.addc char
end
end
lib/markdown/markdown.nit:2086,2--2095,4
redef fun emit(v) do
var tmp = new FlatBuffer
var b = check_html(v, tmp, v.current_text.as(not null), v.current_pos)
if b > 0 then
v.add tmp
v.current_pos = b
else
v.decorator.escape_char(v, char)
end
end
lib/markdown/markdown.nit:2216,2--2225,4
redef fun emit(v) do
var tmp = new FlatBuffer
var b = check_entity(tmp, v.current_text.as(not null), pos)
if b > 0 then
v.add tmp
v.current_pos = b
else
v.decorator.escape_char(v, char)
end
end
lib/markdown/markdown.nit:2254,2--2263,4