Settings - Markdown Editor HTML Sanitization Feature
The HTML Sanitization works with AnswerHub version 2.7+.
AnswerHub now allows for revised handling of HTML within the WMD editor for posted content to render HTML as text only with the displayed tags. This functionality is enhanced in version 2.12 and later to include HTML within both the title and body fields. AnswerHub retains normal rendering of HTML in custom web panels, static pages and site notifications.
Overview
If the user types HTML code in any content type, the content previews and renders as plain text.
- Questions
- Answers
- Comments
- Ideas
- Articles
- Topic Descriptions
NOTE:
This feature is incompatible with Legacy 1.6.6 themes.
Markdown Editor HTML Sanitization Use Cases
Admin Interactions with Markdown Editor HTML Sanitization
As the admin, you can configure the community to use the Markdown editor without stripping HTML tags. You can allow the community to use HTML with other editors or enable users to choose which editor they want to use, as shown in step 5 below.
You can use full HTML when working with custom web panels, site notifications, and static pages even if you set the community to only make use of the Markdown editor and set the editor to store and display HTML as text.
Community User Interactions with Markdown Editor HTML Sanitization
The end user can cut and paste or otherwise post HTML code in the editor and post the code as text with the HTML tags remaining visible. This allows you to ask questions about HTML, while other users can see the HTML as plain text and provide responses that also include HTML as plain text. You can edit your posted questions, comments, answers, ideas, articles and add or modify HTML code examples and re-save. You can continue to use markdown to format your postings.
NOTE:
When you enable this feature, the end user cannot use HTML tags to affect the formatting of their posts within the Markdown editor.
How to Enable This Functionality
To enable Markdown Editor HTML sanitization, do the following:
1. Log In to AnswerHub
First, you will need to log in to your instance of AnswerHub.
2. Navigate to the Administration Dashboard
Navigate to your avatar and select Administration in the drop-down.
3. Navigation to the General Site Settings
Navigate to Site > General > Settings.
4. Enable WMD (Markdown/CommonMark)
Select WMD (Markdown/CommonMark) from the drop-down in the Default Editor Markup field.
5. Toggle the feature on/off
Toggle the feature on/off by selecting/deselecting the box next to the Store and display HTML tag as plain text in Markdown Editor field.
NOTE:
Ensure you have selected WMD (Markdown/CommonMark) from the Default Editor Markup drop-down list. You must either set this as the system default or select Allow user selection to allow users to set their own preference.
If the Markdown editor does not display, navigate to Plugins > Manage Plugins and click on the Disabled Plugins tab. Locate markdown-support and click ENABLE.
NOTE:
Content created with Text and Froala (WYSIWYG) editors will continue to store and process HTML. Any content created with the Markdown editor before enabling this feature will continue to execute HTML tags used outside of code blocks, unless edited and re-saved. The system will prompt users to utilize the editor in which they originally created content. All HTML tag processing will respect sanitization settings.
Results
Without this functionality enabled, the following displays:
When you enable this functionality, the following displays:
Updated over 4 years ago