block
.The block is splitted according to the type of lines it contains.
Some blocks can be splited again recursively like lists.
The in_list
mode is used to recurse on list and build
nested paragraphs or code blocks.
# Recursively split a `block`.
#
# The block is splitted according to the type of lines it contains.
# Some blocks can be splited again recursively like lists.
# The `in_list` mode is used to recurse on list and build
# nested paragraphs or code blocks.
fun recurse(root: MDBlock, in_list: Bool) do
var old_mode = self.in_list
var old_root = self.current_block
self.in_list = in_list
var line = root.first_line
while line != null and line.is_empty do
line = line.next
if line == null then return
end
current_line = line
current_block = root
while current_line != null do
line_kind(current_line.as(not null)).process(self)
end
self.in_list = old_mode
self.current_block = old_root
end
lib/markdown/markdown.nit:289,2--313,4