Drupal: HTML comments errors

Created by janroe

Drupal 4.x, 5.x and 6.x core - perennial This topic is not about user comments on comment threads, but HTML comments inserted into text. Since I started using Drupal at version 4.7 it has handled HTML comments badly. That is the

type of HTML comment.

HTML comment errors

In some core versions the HTML comments would simply rendered to readers, in some cases they would not be visible as intended, in other cases HTML comments have been doubled up in the edit screen, with or without rendering to the user. Currently they are not visible as intended but cause paragraph breaks. Basically you don't know what happens from one core upgrade to another. This may look like a small issue, but if you're used to using comments for internal reference, this is no just very annoying but it spells serious trouble. It's also not good for Drupal's standing as a major cms.

"Input formats"

Of course, Input formats play a role here. For HTML comments to work at all, the correct Input format must be used. The HTML comments should work correctly in default Full HTML format. In Full HTML input format the HTML filter - which restricts HTML - should not be enabled. For Filtered HTML or a newly defined Input format, the HTML filter can/should be enabled while HTML comments can be entered into the exceptions list at Allowed HTML tags. So that's what I have done all these years.

Current html comment error

Now the I have line breaks where html comments are entered. This happens with both, the Full HTML input format and my special Admin Filtered HTML input format. The latter is generally used by Admin and is similar to the standard Filtered HTML input format while it has a longer list of exceptions in Allowed HTML tags. It includes the HTML comment.

Current solution (?)

Playing around with this as I write this text, I make a startling discovery. The html comments remain in place, not rendering on page, not creating a line break - all as intended - after I remove the html comment from the Allowed HTML tags. On the other hand, when using Full HTML, the paragraph break still happens. This is not quite as it should be? Not sure if the issue is really solved now. Let's see what the next core versions bring. This also means that HTML comments can now be entered by anyone with the default Filtered HTML input format. Maybe that's not such a good idea. It gives the term "comment spam" a whole new dimension.

Related

http://drupal.org/node/97182

tag - solved http://drupal.org/node/222926 - not solved http://drupal.org/node/240312 - not solved http://drupal.org/node/828630 - not solved Contributed module http://drupal.org/project/htmlcomment - not maintained