svg-inline-loader
svg-inline-loader copied to clipboard
Fix regexp not removing multi-line comments
trafficstars
The previous regular expression had two issues:
- It was only able to remove 1-line comments.
- It was not set to be ungreedy, and could potentially remove content between two comments. E.g. when something like
<!-- comment --> content <!-- comment -->does not contain a newline character, the content would actually be removed.
We run into this issue at https://gerrit.wikimedia.org/r/489323. As a temporary workaround we made all our comments 1-line comments, and made sure each comment is on a separate line.