mirror of
https://github.com/danog/sass-site.git
synced 2024-12-12 09:29:58 +01:00
b67fc7928b
* Add htmlproofer to verify links Partially addresses #247 * Make htmlproofer a Rake task * Verify that we don't have leftover Markdown links * Don't build the full Ruby Sass docs before running htmlproofer * Don't check generated documentation * Fix a few more broken links * Add another URL exception * Limit which branches we run tests for * Add more URL exceptions
14 lines
308 B
Ruby
14 lines
308 B
Ruby
require 'html-proofer'
|
|
|
|
class RawMarkdownLink < HTMLProofer::Check
|
|
def run
|
|
@html.search('//text()').each do |node|
|
|
text = create_element(node)
|
|
|
|
if node.text =~ /(\[[^\]]+\](\[[^\]]*\]|\([^)]+\)))/
|
|
add_issue "Broken Markdown link #{$1}.", line: text.line
|
|
end
|
|
end
|
|
end
|
|
end
|