sass-site/lib/raw_markdown_link.rb
Natalie Weizenbaum b67fc7928b Add htmlproofer to verify links (#252)
* 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
2018-12-27 17:32:58 -08:00

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