Class: HtmlCheck
- Inherits:
-
HTMLProofer::Check
- Object
- HTMLProofer::Check
- HtmlCheck
- Defined in:
- lib/html-proofer/check/html.rb
Constant Summary collapse
- SCRIPT_EMBEDS_MSG =
/Element script embeds close tag/
- INVALID_TAG_MSG =
/Tag ([\w\-:]+) invalid/
- INVALID_PREFIX =
/Namespace prefix/
- PARSE_ENTITY_REF =
/htmlParseEntityRef: no name/
Instance Attribute Summary
Attributes inherited from HTMLProofer::Check
#element, #external_urls, #html, #issues, #node, #options, #path, #src
Instance Method Summary collapse
Methods inherited from HTMLProofer::Check
#add_issue, #add_path_for_url, #add_to_external_urls, #blank?, #create_element, #initialize, subchecks
Constructor Details
This class inherits a constructor from HTMLProofer::Check
Instance Method Details
#run ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/html-proofer/check/html.rb', line 7 def run @html.errors.each do |error| = error. line = error.line if =~ INVALID_TAG_MSG || =~ INVALID_PREFIX next unless [:validation][:report_invalid_tags] end if =~ PARSE_ENTITY_REF next unless [:validation][:report_missing_names] end # tags embedded in scripts are used in templating languages: http://git.io/vOovv next if ![:validation][:report_script_embeds] && =~ SCRIPT_EMBEDS_MSG add_issue(, line: line) end end |