mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
asciidoctor/extract-header-ids: make work with definition lists
These were failing because the plugin was copied from an outdated documentation and definition lists don't have the .context method: https://github.com/asciidoctor/asciidoctor/issues/3363
This commit is contained in:
@@ -8,17 +8,12 @@ require 'asciidoctor/extensions'
|
||||
class Main < Asciidoctor::Extensions::TreeProcessor
|
||||
def process document
|
||||
return unless document.blocks?
|
||||
process_blocks document
|
||||
nil
|
||||
end
|
||||
|
||||
def process_blocks node
|
||||
node.blocks.each_with_index do |block, i|
|
||||
if block.context == :section
|
||||
puts block.id
|
||||
(document.find_by context: :section).each do |section|
|
||||
if section.id
|
||||
puts section.id
|
||||
end
|
||||
process_blocks block if block.blocks?
|
||||
end
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user