vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

Cyrillic "й" is replaced by сyrillic "и" in the anchor link

Open v1talii-dev opened this issue 2 years ago • 3 comments

Bug report

Enviroment

Steps to reproduce

  • Add a heading with lowercase cyrillic letter "й" ## Списки пользователей
  • Check generated anchor link. The result should be like this: <h2 id="списки-пользователеи"><a href="#списки-пользователеи" class="header-anchor">#</a> Списки пользователей</h2>

What is expected?

<h2 id="списки-пользователей"><a href="#списки-пользователей" class="header-anchor">#</a> Списки пользователей</h2>

What is actually happening?

Cyrillic "й" is replaced by cyrilliс "и" in the anchor link.

Other relevant information

  • https://github.com/vuejs/vuepress/issues/1815

v1talii-dev avatar Jul 21 '23 16:07 v1talii-dev

@larionov, what do you think this might be related to?

v1talii-dev avatar Jul 24 '23 07:07 v1talii-dev

@v1talii-dev It specifically removes all accents on characters, so it is expected. If we want to keep "й" we would have to make individual custom implementations for different languages. https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/shared-utils/src/slugify.ts#L12-L13

larionov avatar Jul 28 '23 05:07 larionov

@larionov How can this behavior be redefined not only for the first heading level, but also for the second, third?

v1talii-dev avatar Jul 28 '23 07:07 v1talii-dev