Skip to content
Permalink

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
Choose a base ref
...
head repository: Flet/github-slugger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.4.0
Choose a head ref
  • 8 commits
  • 21 files changed
  • 4 contributors

Commits on Apr 6, 2020

  1. Configuration menu
    Copy the full SHA
    cf8bb5a View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2020

  1. Configuration menu
    Copy the full SHA
    68f7e7c View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2021

  1. Configuration menu
    Copy the full SHA
    156591b View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2021

  1. 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>
    3 people authored Aug 24, 2021
    Configuration menu
    Copy the full SHA
    af59f34 View commit details
    Browse the repository at this point in the history
  2. Use Actions

    wooorm committed Aug 24, 2021
    Configuration menu
    Copy the full SHA
    696afb9 View commit details
    Browse the repository at this point in the history
  3. Update tape

    wooorm committed Aug 24, 2021
    Configuration menu
    Copy the full SHA
    9a83d8c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    912dc06 View commit details
    Browse the repository at this point in the history
  5. 1.4.0

    wooorm committed Aug 24, 2021
    Configuration menu
    Copy the full SHA
    3576e14 View commit details
    Browse the repository at this point in the history
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy