-
Notifications
You must be signed in to change notification settings - Fork 18
BREAKING CHANGE: Don't allow dots (.) in slug #1093
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think we want to always sanitize
anchor
orheader
throughSlugify()
.What was the usecase for removing it from
anchor
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, currently working on this. Switched back to draft.
But I was thinking of limiting the blast radius.
If someone creates a custom anchor, we might want to maintain the dot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having uniformity in our slugging beats allowing dots in custom anchors.
The main reason might be version numbers but they look okay without dots too e.g
#whats-new-in-8.18
vs
#whats-new-in-8-18
I actually prefer the latter visually too.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The slight problem here is that it seems like the default markdown behaviour is to strip the
.
and not replace it with-
.Hence, it would become
#whats-new-in-818
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh but that discrepancy exists today already no?
If someone writes
We slug to:
whats-new-in-8-18
today?I do think that should also be sanitized the same way to
whats-new-in-8-18
.We shouldn't take anchors verbatim and having two sanitation rules is a bit suprising to writers IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem I just thought of is the authoring experience.
It will be confusing if you set a custom anchor and then it's sanitized.
E.g.
If I add the custom anchor
#whats-new-in-8.0
I would expect it to stay like that.It could be confusing to see that it changed to
#whats-new-in-8-0
.Maybe the best way is to actually to discourage dots (
.
) in anchors and make it error?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to sanitize custom anchors anyhoo e.g
#What's-new-in-8.0
we can not take it verbatim. The sanitization is not surprising to me but thats subjective :)We could
hint
if custom anchors end up different after sanitization?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flobernd #1094 should fix the bug you reported.