Skip to content

Commit 696ac4c

Browse files
fabien-simviaclaude
andcommitted
Fold accents to ASCII in the heading slug
A French deck anchored "Données" as "donnes" and "nœuds" as "nuds": the slug kept only [a-z0-9_- ], so every accent was deleted rather than folded. NFD now splits each letter from its accents and the marks are dropped, with the two ligatures that have no canonical decomposition spelled out. index.html and check_tutorial.py fold identically, diffed over accents, ligatures and the punctuation that must still vanish. NFD, not NFKD: NFKD would rewrite degree signs and ellipses and move anchors that already ship. Verified no existing anchor moves — the 45 headings of the two English tutorials slug byte-identically before and after. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8d91737 commit 696ac4c

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

01_preprocessing/CAO_Maillage_Shaper_SMESH/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The course runs in five parts, in the order the original deck presents them:
5959

6060
> **In this part**
6161
> [Les grands principes](#les-grands-principes) ·
62-
> [Une CAO pour la simulation numérique](#une-cao-pour-la-simulation-numrique) ·
62+
> [Une CAO pour la simulation numérique](#une-cao-pour-la-simulation-numerique) ·
6363
> [Redessiner une CAO existante](#redessiner-une-cao-existante) ·
6464
> [Modifier une CAO existante](#modifier-une-cao-existante) ·
6565
> [Les tests](#les-tests) ·
@@ -300,11 +300,11 @@ The course runs in five parts, in the order the original deck presents them:
300300

301301
> **In this part**
302302
> [Objectif](#objectif) ·
303-
> [Données](#donnes) ·
303+
> [Données](#donnees) ·
304304
> [L'esquisse de la plaque](#lesquisse-de-la-plaque) ·
305305
> [Les contraintes](#les-contraintes) ·
306306
> [La face et les groupes](#la-face-et-les-groupes) ·
307-
> [Le maillage : algorithme et hypothèses](#le-maillage--algorithme-et-hypothses) ·
307+
> [Le maillage : algorithme et hypothèses](#le-maillage--algorithme-et-hypotheses) ·
308308
> [Calcul et exportation](#calcul-et-exportation)
309309
>
310310
> *Original deck: slides 14–42.*
@@ -896,9 +896,9 @@ The course runs in five parts, in the order the original deck presents them:
896896
## Part 5 · Exercice n°2
897897

898898
> **In this part**
899-
> [Objectif du tube coudé](#objectif-du-tube-coud) ·
900-
> [Données du tube coudé](#donnes-du-tube-coud) ·
901-
> [Principe général](#principe-gnral) ·
899+
> [Objectif du tube coudé](#objectif-du-tube-coude) ·
900+
> [Données du tube coudé](#donnees-du-tube-coude) ·
901+
> [Principe général](#principe-general) ·
902902
> [Analyse](#analyse) ·
903903
> [Les esquisses du tuyau](#les-esquisses-du-tuyau) ·
904904
> [Le chemin et le tuyau](#le-chemin-et-le-tuyau) ·

index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,16 @@ <h2>On this page</h2>
155155
const bar = document.querySelector("#bar i");
156156

157157
// GitHub-style heading anchors, so the in-page links in the READMEs work.
158+
// Accents are folded to ASCII before the class below drops everything outside
159+
// [a-z0-9_- ]: a French deck would otherwise anchor "Données" as "donnes" and
160+
// "nœuds" as "nuds". NFD splits a letter from its accents, \p{M} deletes the
161+
// accents, and the two ligatures that have no decomposition are spelled out.
162+
// check_tutorial.py must fold identically — see the note on slug() there.
158163
const slug = (s) => s.toLowerCase().trim()
159-
.replace(/<[^>]+>/g, "").replace(/[^\w\- ]/g, "").replace(/ /g, "-");
164+
.replace(/<[^>]+>/g, "")
165+
.replace(/œ/g, "oe").replace(/æ/g, "ae")
166+
.normalize("NFD").replace(/\p{M}/gu, "")
167+
.replace(/[^\w\- ]/g, "").replace(/ /g, "-");
160168

161169
function render(md, base) {
162170
const code = [], math = [];

0 commit comments

Comments
 (0)