Skip to content

Conversation

aleaforny
Copy link

Let's take this example string : This IS- a C/O/MPLEX STRING - look@THAT

According to regular slugifiers (https://slugify.online/), this string slugified should be this-is-a-complex-string-lookthat

However, with default slugify(), it will returns a strange string with additional dashes, thus, not very slugify-friendly.

Here the output : this-is--a-complex-string---lookatthat


With the codes changes, slugify() returns the expected string (I just also modified the remplacements.dart files to my convenience in order to prevent the '@' to become 'at', but I guess it depends on your system and your expectations)


Explanations

  • Somehow, the _dupeSpaceRegExp has been fixed.
  • Then, the substition between the two regexes _dupeSpaceRegExp and _punctuationRegExp were to fix too; I changed the order. Now works as expected.

Let's take this example string : `This IS- a C/O/MPLEX STRING - look@THAT`

According to regular slugifiers (https://slugify.online/), this string slugified should be `this-is-a-complex-string-lookthat`

However, with default slugify(), it will returns a strange string with additional dashes, thus, not very slugify-friendly.

Here the output : `this-is--a-complex-string---lookatthat`

_____________

With the codes changes, slugify() returns the expected string (I just also modified the `remplacements.dart` files to my convenience, but I guess it depends on your system.

____________
**Explanations**

Somehow, the `_dupeSpaceRegExp` has been fixed.
Then, the substition between the two regexes `_dupeSpaceRegExp` and `_punctuationRegExp` were to fix too; I changed the order. Now works as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants