ericcornelissen/webmangler

Comment-related characters in comments may cause the comment content to be mangled

Closed this issue · 0 comments

Bug Report

WebMangler core v0.1.23

Description

Both the built-in CSS and JavaScript language plugins have problems where comments will be mangled if certain (comment-related) characters appear in the comment.

Progress

  • CSS Language Plugin (#143)
  • JavaScript Language Plugin (#139)

Steps to Reproduce

CSS Language Plugin

Mangle the following CSS using the CSS Language Plugin and the CSS Class Mangler using the pattern cls-[a-z]+. Both .cls-bar and .cls-baz will be mangled even though they're in a comment.

.cls-foo { }
/* / .cls-bar { } */
/* * .cls-baz { } */

JavaScript Language Plugin

Mangle the following JavaScript using the JavaScript Language Plugin and the CSS Class Mangler using the pattern cls-[a-z]+. Both .cls-bar and .cls-baz will be mangled even though they're in a comment.

document.querySelectorAll(".cls-foo");
/* * document.querySelectorAll(".cls-bar"); */
/* / document.querySelectorAll(".cls-baz"); */