Skip to content

Table of Content block link breaks, if a subheading contains cursive words or links #8340

Description

@rioksane

Describe the bug
Table of Content block link breaks, if subheading contains cursive words or links

To Reproduce
Steps to reproduce the behavior:

  1. Go to a modern Volto page, e.g. demo.plone.org
  2. Add a page and add text blocks and add subheadings (H2 or H3)
  3. Add cursive to a subheadings "This is Subheading" or add link to a subheading
  4. Add Table of Contents block
  5. Witness the automatic link in ToC break

Expected behavior
Automatic link to a subheading in ToC should work

Correct link format e.g. https://demo.plone.org/table-of-contents-test#subtitle-1-everything-is-okay

Incorrect formats e.g.:
Cursive in word "not": https://demo.plone.org/table-of-contents-test#subtitle-3-everything-is-not-okay-
Link in word "okay": https://demo.plone.org/table-of-contents-test#subtitle-4-everything-is--okay-

Screenshots

Image Image

Software (please complete the following information):

  • OS: OSX
  • Browser Firefox
    Tested in demo.plone.org on June 16, 2026:

Volto 19.1.1
Plone 6.2.0
plone.restapi 10.0.0
CMF 3.8
Zope 6.1
Python 3.13.13 (main, May 8 2026, 20:06:43) [GCC 12.2.0]
PIL 12.2.0 (Pillow)

Additional context
Also breaks in older Volto versions, like:
Volto 18.8.2
Plone 6.0.13
plone.restapi 10.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions