Output that token using MarkdownEmitter::decorator.

Property definitions

markdown $ Token :: emit
	# Output that token using `MarkdownEmitter::decorator`.
	fun emit(v: MarkdownProcessor) do v.decorator.add_char(v, char)
lib/markdown/markdown.nit:1968,2--1969,64

markdown $ TokenEm :: emit
	redef fun emit(v) do
		var tmp = v.push_buffer
		var b = v.emit_text_until(v.current_text.as(not null), pos + 1, self)
		v.pop_buffer
		if b > 0 then
			v.decorator.add_em(v, tmp)
			v.current_pos = b
		else
			v.addc char
		end
	end
lib/markdown/markdown.nit:1981,2--1991,4

markdown $ TokenStrong :: emit
	redef fun emit(v) do
		var tmp = v.push_buffer
		var b = v.emit_text_until(v.current_text.as(not null), pos + 2, self)
		v.pop_buffer
		if b > 0 then
			v.decorator.add_strong(v, tmp)
			v.current_pos = b + 1
		else
			v.addc char
		end
	end
lib/markdown/markdown.nit:2008,2--2018,4

markdown $ TokenCode :: emit
	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

markdown $ TokenLinkOrImage :: emit
	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

markdown $ TokenHTML :: emit
	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

markdown $ TokenEntity :: emit
	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

markdown $ TokenEscape :: emit
	redef fun emit(v) do
		v.current_pos += 1
		v.addc v.current_text.as(not null)[v.current_pos]
	end
lib/markdown/markdown.nit:2308,2--2311,4

markdown $ TokenStrike :: emit
	redef fun emit(v) do
		var tmp = v.push_buffer
		var b = v.emit_text_until(v.current_text.as(not null), pos + 2, self)
		v.pop_buffer
		if b > 0 then
			v.decorator.add_strike(v, tmp)
			v.current_pos = b + 1
		else
			v.addc char
		end
	end
lib/markdown/markdown.nit:2320,2--2330,4