class HtmlCheck

Constants

DOCTYPE_MSG
EOF_IN_TAG
INVALID_PREFIX
INVALID_TAG_MSG
MISMATCHED_TAGS
PARSE_ENTITY_REF
SCRIPT_EMBEDS_MSG

tags embedded in scripts are used in templating languages: git.io/vOovv

Public Instance Methods

report?(message) click to toggle source
# File lib/html-proofer/check/html.rb, line 18
def report?(message)
  case message
  when SCRIPT_EMBEDS_MSG
    options[:validation][:report_script_embeds]
  when INVALID_TAG_MSG, INVALID_PREFIX
    options[:validation][:report_invalid_tags]
  when PARSE_ENTITY_REF
    options[:validation][:report_missing_names]
  when DOCTYPE_MSG
    options[:validation][:report_missing_doctype]
  when EOF_IN_TAG
    options[:validation][:report_eof_tags]
  when MISMATCHED_TAGS
    options[:validation][:report_mismatched_tags]
  else
    true
  end
end
run() click to toggle source
# File lib/html-proofer/check/html.rb, line 12
def run
  @html.errors.each do |error|
    add_issue(error.message, line: error.line) if report?(error.message)
  end
end