-
Notifications
You must be signed in to change notification settings - Fork 34
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: Flet/github-slugger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: Flet/github-slugger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.4.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 8 commits
- 21 files changed
- 4 contributors
Commits on Apr 6, 2020
-
Configuration menu - View commit details
-
Copy full SHA for cf8bb5a - Browse repository at this point
Copy the full SHA cf8bb5aView commit details
Commits on Sep 9, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 68f7e7c - Browse repository at this point
Copy the full SHA 68f7e7cView commit details
Commits on Aug 22, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 156591b - Browse repository at this point
Copy the full SHA 156591bView commit details
Commits on Aug 24, 2021
-
Fix to match GitHub’s algorithm on unicode
I reverse engineered GitHub’s slugging algorithm. Somewhat based on #25 and #35. To do that, I created two scripts: * `generate-fixtures.mjs`, which generates a markdown file, in part from manual fixtures and in part on the Unicode General Categories, creates a gist, crawls the gist, removes it, and saves fixtures annotated with the expected result from GitHub * `generate-regex.mjs`, which generates the regex that GitHub uses for characters to ignore. The regex is about 2.5kb minzipped. This increases the file size of this project a bit. But matching GitHub is worth it in my opinion. I also investigated regex `\p{}` classes in `/u` regexes. They work mostly fine, with two caveats: a) they don’t work everywhere, so would be a major release, b) GitHub does not implement the same Unicode version as browsers. I tested with Unicode 13 and 14, and they include characters that GitHub handles differently. In the end, GitHub’s algorithm is mostly fine: strip non-alphanumericals, allow `-`, and turn ` ` (space) into `-`. Finally, I removed the trim functionality, because it is not implemented by GitHub. To assert this, make a heading like so in a readme: `#  `. This is a space encoded as a character reference, meaning that the markdown does not see it as the whitespace between the `#` and the content. In fact, this makes it the content. And GitHub creates a slug of `-` for it. Closes GH-22. Closes GH-25. Closes GH-35. Closes GH-38. Co-authored-by: Dan Flettre <flettre@gmail.com> Co-authored-by: Jack Bates <jack@nottheoilrig.com>
Configuration menu - View commit details
-
Copy full SHA for af59f34 - Browse repository at this point
Copy the full SHA af59f34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 696afb9 - Browse repository at this point
Copy the full SHA 696afb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a83d8c - Browse repository at this point
Copy the full SHA 9a83d8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 912dc06 - Browse repository at this point
Copy the full SHA 912dc06View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3576e14 - Browse repository at this point
Copy the full SHA 3576e14View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.3.0...v1.4.0