After updating, Questions and Options are not accepting (save) “\”
After updating, Questions and Options are not accepting (save) “\” from keyboard, Earlier (upto version 1.8.15) I was using to write latex Example: π \pi, \θ \theta, \frac27 etc in question and options blocks.
Hi Ajay,
the new version sanitizes things much more aggressively to ensure cross version compatibility as well as security. However, I like the idea of being easily able to write in latex format.
Can you provide an exact example of what it is that you want to enter as a field value? You can use pastecode.io to avoid formatting issues and sanitization here on this forum.
I’ll try and take a look at it today and push out an update for you. A holiday present 🙂
OK, I just went down a deep rabbit hole.
tldr Reinstall HD Quiz to get the fresh updated files. Should work for you now.
WordPress actually completely strips out all slashes when saving metadata. Period. Even if I manually saved a custom array with slashes in a string, WordPress would remove it before it reaches the database. Luckily, they also have a custom function wp_slash
that essentially doubles up on properly escaped slashes, allowing the data to save as intended.
This is also great because, in theory, it should allow all of your latex variations to go through. This “solution” however, appears to be a “workaround” for a long-standing bug in WordPress. Interesting that after all these years I still discover new quirks of the platform 🙂
Thanks, Dylan,
Really appreciate your great support, and thank you for creating such a wonderful quiz plugin.
Reinstalling fixed the issue in the options field, but the title field is still not accepting slashes.
I am attaching a screenshot to help visualize the problem.
https://sscstudy.com/wp-content/uploads/2024/12/latex-in-HD-Quiz-1.jpg
https://sscstudy.com/wp-content/uploads/2024/12/latex-in-HD-Quiz.jpg
Same issue, same fix 🙂
Just updated to fix this too. Please reinstall to get the patch
Respond to thread
This thread has been closed / marked as resolved.
You can reply to this thread, but it might be better to start a new thread if you need help.
You can also upload images to imgur and paste the links here. Just make sure that your images don't include any sensitive information.
Submit