Closed (fixed)
Project:
Drupal core
Component:
filter.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2003 at 11:38 UTC
Updated:
24 Aug 2004 at 21:20 UTC
Is there any method to disable all filter? I want to insert a program code block. But "<" and ">" make some troubles. It is treated as a disallowed HTML tags and some code blocks are removed. I think if a disallowed tags are found, it should be renderd as "<" and ">".
("&" is also rendered as "&")
And I suggest another approach. Use an bbcode or wiki module as a default renderer. It is a kind of structured text and easy to learn, I think.
Comments
Comment #1
ax commented"<" and ">" are not treated as "disallowed HTML tags" (they are no tags), but as what they are: [ html special characters | http://www.w3.org/TR/html4/charset.html#h-5.3.2 ]. if you want them to display literally - like in a block of program code, you have to escape them as mentioned in that link. as they are used as html tag delimiters, there is no way around this.
apart from using a bbcode, htmlarea, wiki, etc. module, which all exists as contributions. they certainly make it easier for average users to post formatted text (just thinking of the many forum posts not properly escaping html special chars). using any of them as the default renderer may be an option. what do people think? which of the many modules should be used as default renderer?
changing title of this feature request.
Comment #2
moshe weitzman commentedI agree that at least one of those filter modules should ship with drupal core and be active by default. The 'write your own HTML' approach that drupal offers today doesn't work well for the average user, and often frustrates advanced users too. the HTMLArea.module looked promising for a while but it seems not to be under active development anymore.
Has anyome tried the latest filter() enhancements in Marco's sandbox? Filter management becomes important when you use a module like bbcode.
Comment #3
(not verified) commentedAs far as I can see a bbcode filter would be ideal for a default, and a htmlspecialchars() filter should be added. This way every code you add would be bbcode and then any HTML would be properly escaped. This would work quite well for those sites requiring forced XHTML compatibilty and stuff.
Comment #4
jonbob commentedI think the new filter system addresses this by allowing users to choose whether they are inputting HTML, plain text, BBCode, etc.
Comment #5
(not verified) commented