Skip to content

Replace Slugify.Core with our own slug method #4835

Open

Description

@Mpdreamz

Replace the Slugify.Core package with a small slug method in Elastic.Documentation, so slugs stay the same across package upgrades and the package stops blocking bumps.

What is getting in your way

Slugify.Core 5.x no longer accepts a null argument, while StringExtensions.Slugify(this string? text) takes a nullable string. The upgrade does not compile without a workaround that hides a behaviour change, so #4834 keeps the package on 4.0.1. The slugs feed anchors, heading ids and changelog links, so a silent change in them breaks links.

What would you like instead

One slug method in Elastic.Documentation that defines the rules we depend on (case, separators, diacritics, null and empty input) and a test that pins them. Move the callers of SlugHelper.GenerateSlug and .Slugify() to it. These are in Elastic.Markdown, Elastic.Documentation, Elastic.Changelog and Elastic.LegacyDocs.Migration. Then remove the Slugify.Core reference.

Anything else

Before replacing it, write tests against 4.0.1 that capture its current output for the headings in docs/, so the new method can be shown to produce identical slugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions