You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
wykopx
changed the title
[Tutorial] Bug in example code 'Add default class for each HTML element'
[Tutorial] Bug in example code 'Add default class for each HTML element' - adding classes only to first element
Jan 20, 2025
On the tutorial page:
https://showdownjs.com/docs/tutorials/add-default-class-to-html/
The code works only for first occurence of each tag in the classMap.
So if you have let's say two different list items:
it will add classes only to the first one because of the buggy RegExp
There is an issue with the code. The line
should be replaced with corrected RegExp version:
Code that adds classes in all elements in markdown text:
The text was updated successfully, but these errors were encountered: