I am currently developing a new Drupal-powered site and experiencing problems with the default HTML filter. I can change the settings all I want, and they always save themselves properly. But they seem to have no effect on the text being displayed in the posts or comments.
Regardless of whether I tell it to strip tags or comment them out, it will comment some out (usually real tags, like <cite>, <code>, or <a href...> which are supposed to be allowed), and others will be stripped out (usually, but not always, things that users have typed with angle brackets like from other script-like languages). It is quite random in what it chooses to be stripped or commented, but is consistent once it has made its choice. I copy the text from a post where it is stripped and paste it into a new post and it might get commented instead.
So as if that wasn't strange enough, the real kicker is that it can't possibly be a problem with the filter files or related. This is because the site experiencing the problem is one part of a Drupal 4.6 multi-site installation. The other site, obviously running off of the same code, works absolutely flawlessly.
Some things I have tried include repeatedly resetting the filter settings to default, rebooting the server, copying the filter files over again with a re-downloaded Drupal (just in case), deleting posts and reposting them, and probably a whole host of really minor desperate shot-in-the-dark type things that had no effect either.
If anyone has any insight into what may be my problem, please, please, let me know. I promise to worship the ground you walk on...for at least a week anyways ;^)
-CdnStrangequark
PS: The default tags allowed include CITE and CODE, but I have to ask why since both are deprecated and display extremely inconsistently across different browsers regardless of your style-sheet settings. Mozilla-based browsers all pre-maturely terminate the tag if there is an intervening line break.
Comments
a href is actually just a
<a href>is actually just<a>- href is a sub set of<a>... I'm not sure about the rest of your problem though. As for<code>- it's a useful tag to have around, as it's good for displaying chunks of code without executing it. I used it all over this post! I use firefox on linux, osx, and xp and have no problems seeing it displayed.I know
I know about <a>, I was just showing an example.
Code and Cite are only useful for defining things as in-line elements. If you try to display it as a block, Mozillas will terminate after the first few line breaks. IE reads until </code> (or cite).
I was just making sure, if
I was just making sure, if you put a href in the acceptible code block it probably wouldn't work.
Codefilter
If you want to display literal pieces of code on your site, use the codefilter module. Other than that, it sounds like you may be changing the tag settings for the wrong filter, or that a contributed filter is causing havoc.
--
If you have a problem, please search before posting a question.
Sorry...
I'm a bit confused. I found some mention of this codefilter module elsewhere but it was vague. I was under the impression that the filter was a part of the current HTML filtering mechanism. Anyone have more information?
(I'm definitely not changing the settings for the wrong filter...I'm doing the same thing I do on all the other sites and it works fine for them)
Contributed module
It's a contributed module which plugs into the filter system. Drupal does not have a fixed set of filters, you can mix and match them in any way you want.
See the codefilter project page.
--
If you have a problem, please search before posting a question.
This worked...sort of.
Thanks Steven, sorry for not searching on Codefilter...I had been searching for "filter" all day with very little success.
This did sort of fix my problem but has introduced a new one. I have searched more on codefilter and there seems to be no way to get it to coexist with the existing HTML filter. I tried rearranging the filter order but to no avail; this only succeeded in making HTML entities in the code block appear in their code version (like nbsp, etc...).
The alternative here is then to create a new input format that only runs codefilter, and leave the default as it was. But this is not a very attractive solution, since all users can then write any HTML tags they feel like, as long as they select the codefilter-only format.
Anyone have a solution? Should I add a feature request to codefilter for this?
Further problems
After enabling codefilter and then disabling it, everything went to hell. I can no longer have anything NOT run through codefilter...if codefilter is not enabled on the default input format, ALL HTML is commented...even the stuff added by the regular line break filter!
Update
Just to complete this story, in case this ever happens to anyone else, I have since managed to fix the problem.
It was not a nice pleasant fix though, as I ended up having to delete the database and regenerate the site from scratch (although I did not reinstall the files themselves, just the database). Then, the first thing I did was enable codefilter and leave it with the default setttings. All has since worked fine.