Sha256: ceb994a10dc7aa2b83bd0841f70647e1760efc5f95a699c2a73f7e8b6371ff04
Contents?: true
Size: 745 Bytes
Versions: 9
Compression:
Stored size: 745 Bytes
Contents
# encoding: utf-8 class ScriptCheckable < ::HTML::Proofer::Checkable def src real_attr @src end def missing_src? !src end def blank? @content.strip.empty? end end class ScriptCheck < ::HTML::Proofer::CheckRunner def run @html.css('script').each do |s| script = ScriptCheckable.new s, self next if script.ignore? next unless script.blank? # does the script exist? if script.missing_src? add_issue('script is empty and has no src attribute', s.line) elsif script.remote? add_to_external_urls script.src else add_issue("internal script #{script.src} does not exist", s.line) unless script.exists? end end external_urls end end
Version data entries
9 entries across 9 versions & 1 rubygems