dokuwiki-plugin-bootswrapper
dokuwiki-plugin-bootswrapper copied to clipboard
Random CSS id selector sometimes starts with a number - which is forbidden
Hi! I'm using the accordion from your plugin and it is perfect!
I think I found a bug: in L244 of script.js the accordion_id is created using the random function from Math, getting a string which represents a number in base 36: accordion_id = Math.random().toString(36).substr(2, 9)
. This string sometimes starts with a number and this is forbidden in the HTML specification: when this happens the accordion doesn't work.
I tried to solve this bug modifying that line in this way accordion_id = 'e_' + Math.random().toString(36).substr(2, 9)
and it works!
Thanks for your work, Manuele
Hi! I'm using the accordion from your plugin and it is perfect! I think I found a bug: in L244 of script.js the accordion_id is created using the random function from Math, getting a string which represents a number in base 36:
accordion_id = Math.random().toString(36).substr(2, 9)
. This string sometimes starts with a number and this is forbidden in the HTML specification: when this happens the accordion doesn't work. I tried to solve this bug modifying that line in this wayaccordion_id = 'e_' + Math.random().toString(36).substr(2, 9)
and it works!Thanks for your work, Manuele
I applied your suggested fix to my fork https://github.com/Miro-Collas/dokuwiki-plugin-bootswrapper which resulted it being added to my PR #145