keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

removing CSS and JavaScript comments edge case and limitations #187

Closed coreykn closed 3 years ago

coreykn commented 3 years ago

Removing inline CSS and JavaScript comments was introduced in version 1.6.1 (PR #184). While this fixed one issue it also introduced a new issue. If a URL has a double forward slash in the file path, such as https://www.example.com/wp-content/uploads//example.jpg, it is being caught as a comment.

Furthermore, the following types of comments are not being matched:

/**/

/**
 * example
 */

WordPress topic: