Skip to content

Only Japanese title convert to empty slug #225

@kkd

Description

@kkd

Symptom

If you post a long sentence with a Japanese-only title, SLUG will be EMPTY.

When I post a long post with only Japanese title in Diamond's long post, SLUG becomes empty. If the title contains alphanumeric characters, only those are recognized as slug.

Maybe same problem occur in Chinese, etc.

For Example

`
> const slug = (str) => str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9 -]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-");
undefined
> console.log(slug("what is this?"));
what-is-this
undefined
> console.log(slug("日本語が入ったらどうなる?"));

undefined
> console.log(slug("ex) 日本語が入ったらどうなる2?"));
ex-2
undefined
> console.log(slug("ex) blogタイトルに日本語が入ったらどうなる2?"));
ex-blog2
undefined
> console.log(slug("ex) blogタイトルに日本語が入ったらどうなる 2?"));
ex-blog-2
undefined
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions