17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/asciidoctor/standoc/macros_note.rb', line 17
def process(document)
(document.find_by context: :paragraph).each do |para|
next unless /^TODO: /.match? para.lines[0]
parent = para.parent
para.set_attr("name", "todo")
para.set_attr("caption", "TODO")
para.lines[0].sub!(/^TODO: /, "")
todo = Block.new(parent, :admonition, attributes: para.attributes,
source: para.lines,
content_model: :compound)
parent.blocks[parent.blocks.index(para)] = todo
end
end
|