diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 82d85d34..1ba668e5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,13 +20,13 @@ jobs:
steps:
- uses: actions/checkout@v2
+ - name: Install libxslt and libxml2
+ run: sudo apt-get install libxslt-dev libxml2-dev
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
# bundler-cache: true
- - name: Install libxslt and libxml2
- run: sudo apt-get install libxslt-dev libxml2-dev
- name: Install dependencies
run: bundle install
- name: Run tests
diff --git a/.rubocop.yml b/.rubocop.yml
index cab6b95a..8437a0c5 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,17 +1,3 @@
-AllCops:
- Exclude:
- - "vendor/**/*"
-
inherit_gem:
rubocop-standard:
- config/default.yml
-
-Style/StringLiterals:
- Enabled: true
- EnforcedStyle: single_quotes
-
-Naming/FileName:
- Enabled: false
-
-Style/Documentation:
- Enabled: false
diff --git a/lib/html-proofer.rb b/lib/html-proofer.rb
index d828b453..bd3711d1 100644
--- a/lib/html-proofer.rb
+++ b/lib/html-proofer.rb
@@ -1,3 +1,4 @@
+# rubocop:disable Naming/FileName
# frozen_string_literal: true
def require_all(path)
@@ -52,3 +53,4 @@ def self.check_links(links, options = {})
HTMLProofer::Runner.new(links, options)
end
end
+# rubocop:enable Naming/FileName
diff --git a/lib/html-proofer/runner.rb b/lib/html-proofer/runner.rb
index d37523c7..e853ac3c 100644
--- a/lib/html-proofer/runner.rb
+++ b/lib/html-proofer/runner.rb
@@ -214,7 +214,8 @@ def print_failed_tests
sorted_failures.sort_and_report
count = @failures.length
failure_text = pluralize(count, 'failure', 'failures')
- raise @logger.colorize :fatal, "HTML-Proofer found #{failure_text}!"
+ @logger.log :fatal, "\nHTML-Proofer found #{failure_text}!"
+ exit 1
end
# Set before_request callback.
diff --git a/lib/html-proofer/url_validator.rb b/lib/html-proofer/url_validator.rb
index a07a8c3e..4cf85c11 100644
--- a/lib/html-proofer/url_validator.rb
+++ b/lib/html-proofer/url_validator.rb
@@ -120,7 +120,7 @@ def establish_queue(external_urls)
def clean_url(href)
# catch any obvious issues, like strings in port numbers
parsed = Addressable::URI.parse(href)
- if href =~ /^([!#{$&}-;=?-\[\]_a-z~]|%[0-9a-fA-F]{2})+$/
+ if href =~ /^([!#{Regexp.last_match(0)}-;=?-\[\]_a-z~]|%[0-9a-fA-F]{2})+$/
href
else
parsed.normalize
diff --git a/spec/html-proofer/fixtures/links/hash/inner.html b/spec/html-proofer/fixtures/links/hash/inner.html
new file mode 100644
index 00000000..8f49f052
--- /dev/null
+++ b/spec/html-proofer/fixtures/links/hash/inner.html
@@ -0,0 +1,7 @@
+English below
+
+
+
+
+