• Resolved joachimbrindeau

    (@joachimbrindeau)


    Hello,

    When there is an accent in the existing ID of the heading to be linked to, the table of content cannot scroll.

    Steps to reproduce:

    • Add a heading to your content
    • Add an ID with an accent (example: Il est rentré)
    • Add a table of content block by greenshift

    You can see a live version on my friend’s French chauffeur website.

    Thank you for your help

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpsoul

    (@wpsoul)

    Ids and anchors must use only latin and numeric symbols. This is limitation of browser and not plugin. You can make different heading name and id, but id must be always transliterated

    Plugin Author wpsoul

    (@wpsoul)

    closing as no activity

    Thread Starter joachimbrindeau

    (@joachimbrindeau)

    sorry I did not see you answered.

    I agree but the normal way would be to normalize the words with something like this (script I use in n8n)

    const title = heading here; let slug = title.normalize(“NFD”).replace(/[\u0300-\u036f]/g, “”).replace(/\/|\s/g, ‘-‘).toLowerCase().replace(/[^a-z0-9-]+/g, ”); slug = slug.replace(/-+/g, ‘-‘); const words = slug.split(‘-‘); const deduped = […new Set(words)]; slug = deduped.join(‘-‘); return [{ json: { slug } }];

    that way I can have headings in French and a ToC that still works fine.

    I hope I am clearer

    thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[BUG] Table of contents and accents’ is closed to new replies.