motopress / getwid

Extra Gutenberg blocks for building seamless and aesthetic websites in the WordPress block editor.
https://motopress.com/products/getwid/
GNU General Public License v2.0
36 stars 14 forks source link

Table of Contents Block ID generation should follow HTML ID specification - starting with a letter #68

Closed dennisheiden closed 2 years ago

dennisheiden commented 2 years ago

Problem: Table of Contents Block generates random IDs for anchors href / headings. Those IDs always start with a number which could lead to compatible issues with browsers or scripts somehow.

Solution: Add a letter like "g" at the beginning of those generated IDs.

id="086ba949a5bb" -> id="g086ba949a5bb"

Specification: https://developer.mozilla.org/de/docs/Web/HTML/Global_attributes/id

"... Though this restriction has been lifted in HTML 5, an ID should start with a letter for compatibility."