Invalid anchor names

Created on 27 September 2024, about 2 months ago

I noticed this problem for the Layout styleguide plugin. The layout elements are grouped by the layouts' category as defined in a layout.yml file. That name is inserted into the anchor names and the element ToC links as-is, with no verification of uniqueness or reformatting. So given a layout category named "Columns: 1" you end up with anchors like:

<a name="Columns: 1"></a>

...and ToC links like:

<a href="https://mysite.ddev.site/admin/appearance/styleguide#Columns: 1">Columns: 1</a>

The colons and spaces are invalid characters, causing validation errors to be thrown which is how I found the problem.

Suggested fix

Run all element keys through Html::getUniqueId() in StyleguideController.

πŸ› Bug report
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States dcam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024