Skip to content

Commit

Permalink
Added custom-built jar and test for HTML5 markdown checking
Browse files Browse the repository at this point in the history
Thanks to @metal450 and @sideshowbarker for discussing how to make validation work for full RDFa in [this issue](validator/validator#189)!
  • Loading branch information
cdchapman committed Oct 28, 2016
1 parent 7804e7f commit 9ff81df
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Checks
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
deploy_check :internal_links
deploy_check :mixed_content
deploy_check :stale
deploy_check :no_unprocessed_erb
require 'open3'
require 'json'

check :html5 do
cmd = "java -jar opt/validator/vnu.jar --format json --skip-non-html --schema http://s.validator.nu/html5-all.rnc #{@config[:output_dir]}"
res = Open3.popen3(cmd) { |_stdin, _stdout, stderr| stderr.read }

JSON.parse(res).fetch('messages', []).each do |err|
subject = err['url'].sub(/^file:#{Regexp.escape File.dirname(__FILE__)}\//, '')
add_issue("#{err['message']} (line #{err['lastLine']}, column #{err['firstColumn']})", subject: subject)
end
end

check :no_unprocessed_erb do
@output_filenames.each do |filename|
Expand All @@ -11,4 +19,11 @@ check :no_unprocessed_erb do
end
end


deploy_check :internal_links
deploy_check :mixed_content
deploy_check :stale
deploy_check :no_unprocessed_erb
deploy_check :no_unprocessed_markdown

# vi: ft=ruby
1 change: 1 addition & 0 deletions opt/validator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.10.27
Binary file added opt/validator/vnu.jar
Binary file not shown.

1 comment on commit 9ff81df

@sideshowbarker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool 👍

Please sign in to comment.