Skip to content

Commit

Permalink
Merge pull request #91 from betagouv/maud/fix_fragment_key
Browse files Browse the repository at this point in the history
Fix fragment key
  • Loading branch information
jillro authored Jan 27, 2025
2 parents 3e44cd9 + ab334fc commit f137c21
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/(container)/glossaire/[letter]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { notFound } from "next/navigation";
import AlphabeticNav from "@/components/AlphabeticNav";
import sanitizeHtml from "sanitize-html";
import slugify from "slugify";
import { Fragment } from "react";

export const dynamic = "error";
export const dynamicParams = true;
Expand Down Expand Up @@ -57,7 +58,12 @@ export default async function Page(props: {
url={(letter) => `/glossaire/${letter}`}
/>
{definitions.map((definition) => (
<>
<Fragment
key={slugify(definition.Nom_glossaire as string, {
lower: true,
strict: true,
})}
>
<h2
className={fr.cx("fr-h6", "fr-mt-4w", "fr-mb-1w")}
id={slugify(definition.Nom_glossaire as string, {
Expand All @@ -77,7 +83,7 @@ export default async function Page(props: {
),
}}
/>
</>
</Fragment>
))}
</div>
</div>
Expand Down

0 comments on commit f137c21

Please sign in to comment.