Hello,

I'm not sure if this is a bug, but I'd like to mention this here. I typed a few article in my new Drupal install, using <h2> tags with the "Filtered HTML" option. I then realized that <h2> was not permitted, so I added it to the list of allowable tags in the "Filtered HTML" options. But my articles' formatting did not update. I had to edit the articles and re-save them to get the <hX> tags to start working. This could be a problem if I had many articles and decided later to change the allowable tags. Any comments?

Thanks for the help!

Comments

rahim123’s picture

Ooops sorry about the formatting. I was trying to talk about the < h 2 > tag, not format my comment. Let me try again....

I typed a few article in my new Drupal install, using < h 2 >
tags with the "Filtered HTML" option. I then realized that the tags were not permitted, so I added them to the list of allowable tags in the "Filtered HTML" options. But my articles' formatting did not update. I had to edit the articles and re-save them to get the tags to start working. This could be a problem if I had many articles and decided later to change the allowable tags. Any comments?

vm’s picture

I added code tags to your original post. For future reference when you want to place HTML in your posts on drupal.org use <code>ADD YOUR CODE HERE</code> tags

changing of input formats is not retroactive. The node is saved in the DB with the settings it had when saved. You are correct that you have to edit the node in question and resave it.

I slightly disagree with the assement you've made. I think you would have recognized your tags not rendering properlly before you had "too" many nodes that required a change to an input format. Tags that weren't being used before a change is made, in theory, wouldn't even be used for an older node, as these tags were unallowed. Therefore if you decided to allow a tag, you would end up editing the node any way, to add the tags you are now allowing.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

rahim123’s picture

Hmmm, I guess you're right. In my case I only had two articles, but I thought it could be a problem for users with more content.

At any rate, is there an option to "regenerate all articles" or anything like that?

What if I later switch to a different input method? I am thinking about moving to Textile or Markdown soon. Will articles that I type in filtered HTML later be editable with Textile, or will they be converted, or is the formatter on a per-node basis?

Thanks for the help!

vm’s picture

The node would have to be saved with the filter for it to be output with the filter.

I would venture a guess that you can write a custom SQL query to alter these in batch form but again, I don't see where that would be needed considering, that if you saved something as FILTERED HTML, you are only using a certain set of tags, this wouldn't change the actualy tags used in a node.

If you allow <b>, then switched to textile <b> would still be allowed no ?
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

rahim123’s picture

Yes, I think so. Good, it's not a big problem then.

arh1’s picture

but wait, just to clarify this for myself, i believe that changes to input formats _are_ "retroactive", it's just that cache needs to be cleared to see them.

that is, i can do the following:
1) <h1> is not allowed by my "Filtered HTML" input format
2) create a node using Filtered HTML that includes the <h1> tag
3) when submitted, the <h1> tag is stripped out, but the text in that tag is still visible
4) add <h1> to the list of "Allowed HTML tags" at /admin/settings/filters/1/configure
5) clear cache
6) view the node again, and the <h1> tag is visible as intended

in other words, the <h1> tag is stored correctly in the db. it's stripped by the input format's HTML filter when the page is rendered, and cached. updating your input format's filter as appropriate and clearing cache should achieve the desired results.

rahim123’s picture

Ah, good to know this. Thanks for clarifying, arh1!

sopia’s picture

So then, to turn this around: In order to make it so that all NEW content has, say, rel="nofollow" (anti-SPAM) on links, but OLD content remains unchanged, the proper procedure would be to:

1. create a new input format with the desired settings
2. make that the default format

This prevents the retroactive action on old posts. In this case, protecting the old nodes from having all of their links made rel="nofollow" even when the cache is cleared, since their input filter type has been unchanged.

Correct?