Skip to content

Commit

Permalink
Merge pull request #2909 from d-torrance/pound-sign
Browse files Browse the repository at this point in the history
Don't percent encode "#" in URL's (breaks named anchors)
  • Loading branch information
DanGrayson committed Aug 12, 2023
2 parents 074b748 + 7e3cdc3 commit 56c9f60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion M2/Macaulay2/m2/html.m2
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ percentEncoding = new MutableHashTable from toList apply(
-- unreserved characters from RFC 3986
-- ALPHA / DIGIT / "-" / "." / "_" / "~"
-- we also add "/" and ":" since they're standard URL characters
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890-._~/:",
-- also "#" for named anchors
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890-._~/:#",
c -> (c, c))
-- everything else will be percent encoded and added to the hash table
-- as needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ doc ///
:String
Description
Text
Encode all of the characters in a URL except for "/", ":", and
Encode all of the characters in a URL except for "/", ":", "#", and
the "unreserved characters" specified by
@HREF{"https://www.rfc-editor.org/rfc/rfc3986.html", "RFC 3986"}@,
i.e., the alphanumeric characters, "-", ".", "_", and "~", using
Expand Down

0 comments on commit 56c9f60

Please sign in to comment.