facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
56.92k stars 8.57k forks source link

"docusaurus write-heading-ids" generates unsupported ids when titles contain accentuated characters #7720

Closed domeav closed 2 years ago

domeav commented 2 years ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

French is the main language of my docusaurus doc project.

After I use the "write-heading-ids" command, titles containing accents are all messed up when I build the website: see demo, screenshot or public link below.

Reproducible demo

https://stackblitz.com/edit/github-dzapan-b7pzge?file=docs/intro.md

Steps to reproduce

  1. Have a title with an accent in a doc markdown page ("## Développement local")
  2. Use "yarn write-heading-ids . docs" (Id is generated properly: "## Développement local {#développement-local}")
  3. Use "yarn build" (or yarn start)

=> the title is not displayed properly as the whole line is handled as a title (see screenshot or intro.md page in demo).

Expected behavior

Two possibilities: either docusaurus should be able to handle title ids containing accents or the "write-heading-ids" command should replace accentuated characters.

First option would be more consistent, since accentuated characters seem to be supported in slugs.

Actual behavior

Screenshot from 2022-07-04 11-31-08

See also output from our CI setup: https://doc.bluemind.net/chore/BMD-40/Premiers_pas_avec_BlueMind/Debuter_avec_le_webmail

Your environment

Self-service

Josh-Cena commented 2 years ago

Hi, this is a bug in our title parsing algo—duplicate of #7603. It will be fixed in the next release (expect one this week).