Skip to content

Commit

Permalink
Merge pull request #486 from gjtorikian/support-unicode-domain
Browse files Browse the repository at this point in the history
Support/test unicode/punnycode domains
  • Loading branch information
gjtorikian authored Aug 2, 2018
2 parents 06710dd + 431b2c0 commit 1acf204
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/html-proofer/fixtures/links/punnycode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>

<body>

<p><a href="http://www.xn--mxaaaiil1bdgepgr1bpt0d.gr/">A real link</a></p>

</html>
7 changes: 7 additions & 0 deletions spec/html-proofer/fixtures/links/unicode_domain.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>

<body>

<p><a href="http://αναπτυξηεφαρμογων.gr">A real link</a></p>

</html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions spec/html-proofer/links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@
expect(proofer.failed_tests.length).to eq 1
end

it 'allows unicode domains' do
fixture = "#{FIXTURES_DIR}/links/unicode_domain.html"
proofer = run_proofer(fixture, :file)
expect(proofer.failed_tests).to eq []
end

it 'allows punnycode domains' do
fixture = "#{FIXTURES_DIR}/links/punnycode.html"
proofer = run_proofer(fixture, :file)
expect(proofer.failed_tests).to eq []
end

it 'passes for broken *nix links' do
fixture = "#{FIXTURES_DIR}/links/broken_unix_links.html"
proofer = run_proofer(fixture, :file)
Expand Down

0 comments on commit 1acf204

Please sign in to comment.