Skip to content

slugify: Any-Latin; Latin-ASCII transliterator and strip_tags: false by default #404

Open

Description

@njoubert-cleverage

Change the defaults of the slugify transformer, kept in 5.x for backward compatibility (#400):

  • transliterator: Any-Latin; Latin-ASCII instead of NFD; [:Nonspacing Mark:] Remove; NFC. The current default only removes the accents: the letters that are not decomposed are then removed by the default replace pattern ("Cœur" becomes c_ur, "Straße" stra_e, "Łódź" odz), and a text without latin letters gives "". Any-Latin; Latin-ASCII gives coeur, strasse, lodz, and transliterates the other scripts.
  • strip_tags: false instead of true. strip_tags() removes everything after a < that does not open a tag ("Tom<Jerry" becomes tom, "<3 love" ""), while most slugified values are not HTML.

Both change the slugs of existing data: document them in UPGRADE.md, with the options to set to keep the 5.x slugs.

Found during the audit v3 (audit-v3-angles.md #193, #194).

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions