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 to add this to a post with base 64 inline images but it killed the output.
Sample base64 data (also be used with audio and video binaries):
<img src="data:image/jpeg;base64,{IMAGE DATA HERE (braces not included)}” alt="name" width="XXX" class="alignleft size-full wp-image-xxx">
Is there a simple way to add to your code to ignore everything inside img, audio and video tags? There are no "<" or ">" inside base64 data but there are "/".
I see this:
if ($tag == 'pre' || $tag == 'textarea') {
$raw_tag = $tag;
}
else if ($tag == '/pre' || $tag == '/textarea') {
$raw_tag = false;
}
But these media tags don't have closing tags, only brackets.
I also saw in your code regular expressions for CSS and Javascript, but they also have closing tags.
I was thinking of 2 options:
A regex that switches to raw from
For example to add in the $pattern: /<(?img).*>
Add an exclusion similar to 'pre' for 'figure'
What would you suggest?
Cheers
Mike
The text was updated successfully, but these errors were encountered:
@mikeperlman - I noticed that, too. The minification code was forked from DVS. My contribution was converting it into a standalone plugin and adding an options page, so I'm not really sure where to start. As data-urls for images become more common, though, this will definitely be an ongoing issue, so I'm glad you started an issue for it.
OK, I discovered that "" is toggle on and toggle off.
Ironically the img tag is the biggest problem as audio and video have closing tags - so I could adapt the toggle code for them and also for figure and embed tags and any other ones that need to have compression off for their contents.
@mikeperlman - It's been a while since I've dug through that script, so if you had the time and desire to try fixing this bug, I'd be most grateful! And if you don't, I completely understand.
Hi Chris
Great plugin!
I tried to add this to a post with base 64 inline images but it killed the output.
Sample base64 data (also be used with audio and video binaries):
<img src="data:image/jpeg;base64,{IMAGE DATA HERE (braces not included)}” alt="name" width="XXX" class="alignleft size-full wp-image-xxx">
Sample base64 data: 0dv4X1oaaWoFc30BEaXvSHWwJGsH9aVtfnpalF508KBW
There is nothing to minify here.
Is there a simple way to add to your code to ignore everything inside img, audio and video tags? There are no "<" or ">" inside base64 data but there are "/".
I see this:
if ($tag == 'pre' || $tag == 'textarea') {
$raw_tag = $tag;
}
else if ($tag == '/pre' || $tag == '/textarea') {
$raw_tag = false;
}
But these media tags don't have closing tags, only brackets.
I also saw in your code regular expressions for CSS and Javascript, but they also have closing tags.
I was thinking of 2 options:
For example to add in the $pattern: /<(?
What would you suggest?
Cheers
Mike
The text was updated successfully, but these errors were encountered: