lib/asciidoctor/iso/validate_section.rb in asciidoctor-iso-0.9.7 vs lib/asciidoctor/iso/validate_section.rb in asciidoctor-iso-0.9.9

- old
+ new

@@ -7,10 +7,11 @@ foreword_validate(doc.root) normref_validate(doc.root) symbols_validate(doc.root) sections_sequence_validate(doc.root) section_style(doc.root) + subclause_validate(doc.root) sourcecode_style(doc.root) asset_style(doc.root) end def foreword_validate(root) @@ -193,9 +194,15 @@ root.xpath("//note").each { |e| note_style(e) } root.xpath("//fn").each { |e| footnote_style(e) } root.xpath(ASSETS_TO_STYLE).each { |e| style(e, extract_text(e)) } asset_title_style(root) norm_bibitem_style(root) + end + + def subclause_validate(root) + root.xpath("//clause/clause/clause/clause/clause/clause/clause/clause").each do |c| + style_warning(c, "Exceeds the maximum clause depth of 7", nil) + end end end end end