I am feeding from one Drupal site to another, creating a FeedAPI feed at www.site1.com pointing to www.site2.com/rss.xml - on Site 2 RSS is set to expose the entire text of an article. On Site 1 it is set to "Allow all HTML" in the FeedAPI settings.

This HTML on Site 2:

<p>Of the various bodies out there who make economic forecasts, the ITEM Club from Ernst and Young is one of the best. Its proud boast is that it is the only independent consultancy which uses the same forecasting model as HM Treasury, so its quarterly reports deserve to be taken seriously. This morning its latest report was published.</p>
<p>“The UK economy is in danger of being crushed between the jaws of world credit and commodity markets, with little prospect of early relief,” began the report. It went on to talk about flirting with recession. Actually, though, a mere flirtation will be a real achievement when seen in the context of what is going on.</p>
<p>The ITEM club predicts growth of 1.5 per cent this year, followed by 1 per cent next. If it is right, and, frankly, the ITEM club has a good track record and it may well be right, then actually the UK will have done extraordinarily well.</p>
<p>The tough one, though, is this:</p>

Becomes this on Site 1, after it is aggregated by FeedAPI:

<p>Of the various bodies out there who make economic forecasts, the ITEM Club from Ernst and Young is one of the best. Its proud boast is that it is the only independent consultancy which uses the same forecasting model as HM Treasury, so its quarterly reports deserve to be taken seriously. This morning its latest report was published.<br />
“The UK economy is in danger of being crushed between the jaws of world credit and commodity markets, with little prospect of early relief,” began the report. It went on to talk about flirting with recession. Actually, though, a mere flirtation will be a real achievement when seen in the context of what is going on.<br />
The ITEM club predicts growth of 1.5 per cent this year, followed by 1 per cent next. If it is right, and, frankly, the ITEM club has a good track record and it may well be right, then actually the UK will have done extraordinarily well.<br />
The tough one, though, is this:<br />

I think there is a bug in _feedapi_call_parsers() - I checked the feed and it is delivering the <p> tags - the <br /> tags were created by FeedAPI on Site 1. After some testing I have discovered that regardless of the "Allowed HTML tags" and the "Allow all HTML" options in FeedAPI's admin settings, FeedAPI *seems to* use the core filter module selected under Input Format when you create the feed node instead.

If this is by design, I found it confusing. Do the FeedAPI settings only get applied in certain situations? If so, there needs to be some help text. But having examined the _feedapi_call_parsers() briefly it looks to me like a logical flaw (there is an if supposedly preventing core filtering if the "Allow all HTML" variable is set, but then it goes ahead and does it anyway).

If they are no longer used at all (legacy), the options and corresponding code could be removed and help text provided explaining this is handled by the Input Format of the feed.

Comments

greg.harvey’s picture

Title: HTML filtering issues - <p> becomes <br /> » HTML filtering issues - FeedAPI options don't appear to have any effect

Just changing title to something more meaningful. =)

aron novak’s picture

Category: bug » feature

FeedAPI should drop this setting and add input format support instead of.
Currently it works as the following:
FeedAPI applies the setting (allowed tags / all tags) to the feed data. But after that, because it's a node, the default input format is applied too.

aron novak’s picture

This is a bug too, but generally the more important is that feedapi should support input formats.

greg.harvey’s picture

To be honest, I'm not sure it's necessary - I mean, I'm perfectly happy with the behaviour where the feed just sends *all* HTML and the receiving client processes it according to their default filter settings in Drupal.

But if you have a specific use case requiring it, fair enough. It's no big deal, like you say - just something I observed. =)

aron novak’s picture

http://drupal.org/project/filterbynodetype
This is what you need btw.
Enable at FeedAPI level all the tags and with the help of this module you can set unfiltered input format (or what you want) for feed items.

traviscarden’s picture

I'd definitely like to see the ability to set more attributes of Feed API-created nodes. I'd like to be able to enable TrackBacks, for example, though I know that's a little different issue, it being contributed module functionality and all. Settings for core functionality, though, like filters and comments I think are important functionality.