While working on #pdf4anki integrated the feature of automatically adding opinionated #CSS with #cheerio to the initial #HTML file. This had the unknown side effect of destroying all the self-closing HTML tags, thus breaking the pattern matching.
The fun of taking apart the code to #debug this issue.
Further learnt the strength of using a callback function for #javascript `String.prototype.replace()` function.
Might integrate it further towards the existing pattern's ruling and thereby reduce the current piecewise nature.