HTML Private Comments

Component ID

1508458

Component name

HTML Private Comments

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

HTML Private Comment provides an input format filter that allows hidden "HTML" comments, i.e., [!-- your hidden content here --].

This project is an update and fork of the original HTMLcomment input filter from TBarregren.

I welcome suggestions for making this code better.

Example of a Private Comment

[!-- This will not be in the HTML and not displayed in the source --]
<!-- This will be in the HTML and displayed in the source -->

Background

An HTML comment is a text surrounded with <!-- and -->. If you put a such comment in a text area, you expect it to be in the HTML code, but not rendered on the screen. When using a WYSIWYG editor, these comments are passed through and displayed in the source of your published content.

Typically, you really don't want a large body of content commented out, but still visible in the source. So this module provides a filter that removes any text or code surrounded with [!-- and --]. The purpose is to allow private comments in WYSIWYG text areas.

(Yes, IE conditional comments use square brackets. I don't have a need for those in my content, but can certainly build this filter to allow them.)