Skip to content

Slug length can be MaxLength+1 #72

@Redlinkk

Description

@Redlinkk

When using the truncate function, the slug can be longer than MaxLength on specific conditions. See this example:

  • original string (of length 11): "abcde-fghij"
  • MaxLength: 10
  • expected string: "abcde"
  • output string: "abcde-fghij"

Current function fails on this edge case because the last word doesn't end with a "-" during the max length test here so the - 1 is wrongfully applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions