if c == '\n' then
eol = true
else if c == '\t' then
- var np = pos + (4 - (pos.bin_and(3)))
+ var np = pos + (4 - (pos & 3))
while pos < np do
value.add ' '
pos += 1
# Kind of emitter used for decoration.
type EMITTER: MarkdownEmitter
+ # Render a single plain char.
+ #
+ # Redefine this method to add special escaping for plain text.
+ fun add_char(v: EMITTER, c: Char) do v.addc c
+
# Render a ruler block.
fun add_ruler(v: EMITTER, block: BlockRuler) is abstract
var char: Char
# Output that token using `MarkdownEmitter::decorator`.
- fun emit(v: MarkdownEmitter) do v.addc char
+ fun emit(v: MarkdownEmitter) do v.decorator.add_char(v, char)
end
# A token without a specific meaning.
if pos == -1 then return -1
end
end
+ if pos < start then return -1
if md[pos] != ')' then return -1
else if md[pos] == '[' then
pos += 1