-
Notifications
You must be signed in to change notification settings - Fork 18
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
HTML questions are ending up as plain text #7
Comments
The survey JSON is sanitized on save into WP database (https://github.com/surveyjs/surveyjs-wordpress/blob/master/ajax_handlers/save_survey.php#L14) in order to cut off potentially malicious content This was the requirement from WP guys before they approved this plugin It looks like this sanitization kills the html question content. We'll check whether we can use less strict sanitization function. In any case you can use any other sanitization function in your local WP instance - just patch this line of code |
Ok. Thanks. What if the plugin was set up with a Markdown hook? That way the save sanitisation wouldn't change the content and the simple things like bold and links could be formatted on viewing? Just a thought for later. |
@flowt-au Thank you for sharing your thoughts and feedback. It is very helpful. SurveyJS library does have markdown hook. We'll consider to use it in the plugin. |
Happy to help. It is a great product! |
I'm looking to see if there is an update on this, or a potential workaround that would allow the html content to be maintained? I am dealing with this issue right now. |
@slatecake This behavior is so due to sanitization of the all texts passed to wordpress server. This was requirement during SurveyJS wordpress plugin approvement. You can change this behavior on your custom wordpress installation. But be aware of security vulnerabilities. |
If I have this in my survey JSON:
the resulting html in the survey is:
i.e. no html tags. I am assuming WP is doing that? Not sure what to do.
Any ideas?
Thanks,
Murray
The text was updated successfully, but these errors were encountered: