Prevent Theme Breakage: Check and Clean HTML from WYSIWYG Editor to Avoid Syntax Errors #3391
empiricompany
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
The observation made is fine. I also mentioned here that in Frontend we have problems with some forms that do not trim what is entered in the text fields and often visitors enter spaces. I came across this in the order form and I had to remove the extra spaces. It is not something serious, but engineering speaking, it can be prevented and gives a good artistic impression. |
Beta Was this translation helpful? Give feedback.
0 replies
-
for sure #3220 will help ;-) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes it happens that the customer enters HTML code in the product description or CMS without properly closing some tags, resulting in the theme breaking on the frontend.
One way to avoid these issues would be to clean the text before saving it in the database, for example, using tidy::cleanRepair().
https://www.php.net/manual/en/tidy.cleanrepair.php
We should try different configuration combinations so that it doesn't alter the HTML but only fixes major errors like tag closure.
You could make it an optional requirement on the server, meaning that the clean function is only executed if the function is available.
Beta Was this translation helpful? Give feedback.
All reactions