You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried adding the static file template processor for some simple variable substitution, and it seems to corrupt my CSS files. The example shows returning emptyString when a variable name doesn’t match, but in my CSS it's finding everything delimited by %, meaning something like
But it seems to limit parameter names, so simply returning the variable name doesn't work either, as it still doesn't then result in an unmodified file.
Looking at the template processing code there’s a comment that suggests a double percent (%%) is an escaped percent, but this is hugely burdensome in a CSS file (for example).
The template processor should instead use a less likely delimiter (say %%), and if it doesn’t find the closing delimiter with some reasonable number of characters (say, 32), leave the content intact (and don’t call the template processor func).
Should I write this up, or am I missing something obvious?
(BTW another discussion says you won't be enhancing this at all, but if all you need is simple variable substitution, it would be nice not to have to bring in a whole other thing. But as-is, I don't think this works at all.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I tried adding the static file template processor for some simple variable substitution, and it seems to corrupt my CSS files. The example shows returning
emptyString
when a variable name doesn’t match, but in my CSS it's finding everything delimited by%
, meaning something likebecomes
But it seems to limit parameter names, so simply returning the variable name doesn't work either, as it still doesn't then result in an unmodified file.
Looking at the template processing code there’s a comment that suggests a double percent (
%%
) is an escaped percent, but this is hugely burdensome in a CSS file (for example).The template processor should instead use a less likely delimiter (say
%%
), and if it doesn’t find the closing delimiter with some reasonable number of characters (say, 32), leave the content intact (and don’t call the template processor func).Should I write this up, or am I missing something obvious?
(BTW another discussion says you won't be enhancing this at all, but if all you need is simple variable substitution, it would be nice not to have to bring in a whole other thing. But as-is, I don't think this works at all.)
Beta Was this translation helpful? Give feedback.
All reactions