lib/asciidoctor/iso/validate_section.rb in asciidoctor-iso-0.7.3 vs lib/asciidoctor/iso/validate_section.rb in asciidoctor-iso-0.7.4
- old
+ new
@@ -13,18 +13,18 @@
asset_style(doc.root)
end
def foreword_validate(root)
f = root.at("//foreword") || return
- s = f.at("./subsection")
- warn "ISO style: foreword contains subsections" unless s.nil?
+ s = f.at("./clause")
+ warn "ISO style: foreword contains subclauses" unless s.nil?
end
def normref_validate(root)
f = root.at("//references[title = 'Normative References']") || return
- f.at("./references") &&
- warn("ISO style: normative references contains subsections")
+ f.at("./references | ./clause") &&
+ warn("ISO style: normative references contains subclauses")
end
ONE_SYMBOLS_WARNING = "ISO style: only one Symbols and Abbreviated "\
"Terms section in the standard".freeze
@@ -141,16 +141,16 @@
names.empty? ||
warn("ISO style: There are sections after the final Bibliography")
end
NORM_ISO_WARN = "non-ISO/IEC reference not expected as normative".freeze
- SCOPE_WARN = "Scope contains subsections: should be succint".freeze
+ SCOPE_WARN = "Scope contains subclauses: should be succint".freeze
def section_style(root)
foreword_style(root.at("//foreword"))
introduction_style(root.at("//introduction"))
scope_style(root.at("//clause[title = 'Scope']"))
- scope = root.at("//clause[title = 'Scope']/subsection")
+ scope = root.at("//clause[title = 'Scope']/clause")
scope.nil? || style_warning(scope, SCOPE_WARN, nil)
end
def sourcecode_style(root)
root.xpath("//sourcecode").each do |x|