core :: Text :: read_until
self
until nend
and append it to the out
buffer.Escape markdown special chars.
# Read `self` until `nend` and append it to the `out` buffer.
# Escape markdown special chars.
private fun read_until(out: FlatBuffer, start: Int, nend: Char...): Int do
var pos = start
while pos < length do
var c = self[pos]
if c == '\\' and pos + 1 < length then
pos = escape(out, self[pos + 1], pos)
else
for n in nend do if c == n then break label
out.add c
end
pos += 1
end label
if pos == length then return -1
return pos
end
lib/markdown/markdown.nit:2345,2--2361,4