class Object
Public Instance Methods
Source
# File lib/mdl/rules.rb, line 567 def check_blockquote(errors, elements) prev = [nil, nil, nil] elements.each do |e| prev.shift prev << e.type if prev == %i{blockquote blank blockquote} # The current location is the start of the second blockquote, so the # line before will be a blank line in between the two, or at least the # lowest blank line if there are more than one. errors << (e.options[:location] - 1) end check_blockquote(errors, e.children) end end
Source
# File lib/mdl/rules.rb, line 148 def check_ul_indent(doc, elements, parent_indent, errors, indent) elements.each do |e| if e.type == :ul el_indent = doc.indent_for(doc.element_line(e)) if parent_indent && (el_indent > parent_indent) && (el_indent - parent_indent != indent) errors << doc.element_linenumber(e) end check_ul_indent(doc, e.children, el_indent, errors, indent) else check_ul_indent(doc, e.children, parent_indent, errors, indent) end end end
Check indentation of nested ul elements relative to their parent ul. Only compare parent-child ul pairs to avoid false positives when unrelated lists appear at different indent levels.