lib/asciidoctor/abstract_block.rb in asciidoctor-2.0.7 vs lib/asciidoctor/abstract_block.rb in asciidoctor-2.0.8

- old
+ new

@@ -36,15 +36,16 @@ super @content_model = :compound @blocks = [] @subs = [] @id = @title = @caption = @numeral = @style = @default_subs = @source_location = nil - case context - when :document, :section + if context == :document || context == :section @level = @next_section_index = 0 @next_section_ordinal = 1 + elsif AbstractBlock === parent + @level = parent.level else - @level = AbstractBlock === parent ? parent.level : nil + @level = nil end end def block? true