minify icon indicating copy to clipboard operation
minify copied to clipboard

%-sign in html- or js-file

Open petricf opened this issue 4 months ago • 1 comments

Have a HTML-File with embedded javascript. It will be rendered by a variable replacement process (Arduino) which replaces all occurrences of %variable% by their respective values before delivering.

Execute:

minify manage.html -o ../compressed/manage.html

I get the following error:

ERROR: cannot minify manage.html: unexpected % in expression on line 115 and column 29 4: var maxfilesize = %MAXSIZE%,

The code above is located in the section.

petricf avatar Aug 06 '25 08:08 petricf

Unfortunately you have to specify valid ECMAScript, and using a %TAG% is not a valid grammar construct in ES. You'd have to run the minifier after replacing the variables, or use a variable delimiter that is valid ES, such as using $MAXSIZE$.

tdewolff avatar Aug 06 '25 13:08 tdewolff