Merge pull request #2702 from capjamesg/patch-1

Add rel=edit attribute to "Suggest an edit" link
This commit is contained in:
Eric Huss 2025-07-14 22:10:14 +00:00 committed by GitHub
commit e152e197c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -181,7 +181,7 @@
</a>
{{/if}}
{{#if git_repository_edit_url}}
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit" rel="edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>
{{/if}}

View file

@ -8,7 +8,7 @@ fn edit_url_template() {
BookTest::from_dir("rendering/edit_url_template").check_file_contains(
"book/index.html",
"<a href=\"https://github.com/rust-lang/mdBook/edit/master/guide/src/README.md\" \
title=\"Suggest an edit\" aria-label=\"Suggest an edit\">",
title=\"Suggest an edit\" aria-label=\"Suggest an edit\" rel=\"edit\">",
);
}
@ -18,7 +18,7 @@ fn edit_url_template_explicit_src() {
BookTest::from_dir("rendering/edit_url_template_explicit_src").check_file_contains(
"book/index.html",
"<a href=\"https://github.com/rust-lang/mdBook/edit/master/guide/src2/README.md\" \
title=\"Suggest an edit\" aria-label=\"Suggest an edit\">",
title=\"Suggest an edit\" aria-label=\"Suggest an edit\" rel=\"edit\">",
);
}