-
Notifications
You must be signed in to change notification settings - Fork 14
Incompatibility with kirby-minify-html + possible fix #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for your suggestion. Your example breaks the Validation because the JSON outputs HTML and the comment falls out. I hope i explained clearly. If i uncomment the oncoming JSON, the validation will work. But i don't know, if the minify will remove that json. I fixed it in 3.4.7. Can you test it? Just let me know |
I am not sure I completely understand. I tried the 3.4.7 fix on a fresh installation, but the error remains. On my end, I got it to work by wrapping the middle I am not sure if this is a good idea, but this is my current workaround. :) |
That will break the inline validation. (Autovalidation during form fill). You can check it in your console:
Your code will probably case an error. Because inside '' will be a JSON with HTML-Code. Which break the comments. Can you confirm that? |
Since I haven't heard anything more, it seems to me that a solution to this problem has been found. I'il close this issue. |
Hi, and thanks for the plugin!
There is an incompatabilty with afbora/kirby-minify-html.
To reproduce, I added the latest versions of both plugins to the starter kit
After adding a form to the home page, and clicking send without any fields filled out, you get both a 404 error and a parse error.
The reason for the error is that the kirby-minify-html plugin removes comments. After some experimentation, I found out that the kirby-minify-html plugin does not remove conditional comments (with the
<!--[if IE]>
syntax), so a fix would perhaps be to change the comments syntax?I tried that with success, and only two files need to be slightly changed:
The changes I did are here:
Basically, these are the changes to the
validation.php
file:<!-- Startvalidation:<?= $form->id() ?> -->
to<!--[Startvalidation:<?= $form->id() ?>]-->
.<?php ?>
to<!--[<?php ?>]-->
.<!-- Endvalidation -->
to<!--[Endvalidation]-->
.Then, in
index.php
, changing the regexp/\<\!-- Startvalidation:'.get('id').' --\>(.*?)\<\!-- Endvalidation --\>/s
/\<\!--\[Startvalidation:' . get('id') . '\]--\>\s\<\!--\[(.*?)\]--\>\s\<\!--\[Endvalidation\]--\>/s
.Do you see any downsides to this change?
The text was updated successfully, but these errors were encountered: