Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check utf8 relative anchors #842

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions spec/html-proofer/check/links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
expect(proofer.failed_checks.first.description).to(match(/internally linking to #noHash; the file exists, but the hash 'noHash' does not/))
end

it "passes for internal links with non-ASCII characters from implicit indexes" do
broken_hash_internal_filepath = File.join(FIXTURES_DIR, "links", "hash_nonascii_dir")
proofer = run_proofer(broken_hash_internal_filepath, :directory, check_internal_hash: true)
expect(proofer.failed_checks).to(eq([]))
end

it "passes for broken internal hash when asked to ignore" do
broken_hash_internal_filepath = File.join(FIXTURES_DIR, "links", "broken_hash_internal.html")
proofer = run_proofer(broken_hash_internal_filepath, :file, check_internal_hash: false)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<body>
<p><a href="../target/#eigentümerschaft">Hash mit ein umlaut</a></p>
<p><a href="../target/#mitarbeit">Hash ohne ein umlaut</a></p>

</body>
</html>

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<html>
<body>
<h2 id="eigentümerschaft">Hier gib's</h2>

blah de blah

<h2 id="mitarbeit">Hier auch</h2>
</body>
</html>