Closed (fixed)
Project:
Atom
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Mar 2006 at 15:55 UTC
Updated:
15 Mar 2007 at 04:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
Robert Daeley commentedThe same issue seems to be taking place with the Markdown module as well.
Comment #2
Robert Daeley commentedComment #3
Robert Daeley commentedAfter a bit of investigation, I've come up with a temporary solution to this problem, at least for the Markdown format (I don't have Textile installed, so someone else will have to confirm).
If you check out the raw XML file atom.module creates, it is creating a proper Atom file with and fields. The atom.module fills these in with the contents of the "teaser" and "body" fields for each node. So far so good.
Strangely, the teaser field is getting formatted correctly -- in other words, the Markdown markup is being converted to regular HTML, as it should be (and as it is on the regular webpage). But the body field atom.module is filling in is the raw Markdown, sans conversion.
Spending a bit of time familiarizing myself with the system, I've not tracked down the exact problem (though I suspect it might be a problem with the node_invoke_nodeapi usage here), but my temporary fix is to simply replace the line (line 179 in my copy of atom.module) that reads
$output .= check_markup($item->body);with this:
$output .= check_markup($item->teaser);All this does is use the same command as on line 173 just above, which calls the properly formatted teaser.
This is not a permanent solution by any means, and is also at the whims of whether or not you use teasers and/or excerpts, but it takes care of things for me until the real fix is in.
Comment #4
Robert Daeley commentedUPDATE: After yet more experimentation, I've discovered the following:
1. atom.module apparently uses the default Input Format to display the body version of the story.
2. If that Input Format is *not* Markdown-capable, the story will not display properly.
3. If it *is* Markdown-capable, but certain HTML tags are forbidden, it will *not* display those.
Although this additional temporary solution isn't for everybody, if you allow Markdown in your default Input Format, and include appropriate HTML formatting+filtering, you will take care of the problem for now.
Comment #5
chrisada commentedI can confirm that setting the default format to use atom makes the feed appears with the atom filter applied.
Comment #6
drummCurrently, $node->teaser and ->body are passed to check_markup() on output. At this point the content has already been filtered with the node's default input format. The second call is unnecessary and removes important allowed markup.
Comment #7
drummComment #8
chrisada commenteddrumm, I just tried your patch. While it makes sense to not check_markup() on output, this does not fix the problem of default filters being applied to all nodes in feeds, instead of node-specific filters.
Comment #9
pete@fiddley.com commentedBefore creating a patch, can someone check if this is really doing what I think it is...
Changed line 141 of atom.module from:
node_invoke($item, 'view', TRUE, FALSE);
To:
node_invoke($item, 'view', TRUE);
The filter_hook doesn't require the 4th parameter and may have been overriding the 3rd.
Comment #10
furmans commentedI also found that the module was only applying the default filter on my site as noted in #5. I want the module to apply the filter of the node and display that in the feed. I'd like to see this behavior in the default blog/feed too. Here's my solution for the fixing the atom feed...
Line 173 of atom.module:
change:
$output .= check_markup($item->teaser);
to:
$output .= check_markup($item->teaser, $item->format, FALSE);
Line 179 of atom.module:
change:
$output .= check_markup($item->body);
to:
$output .= check_markup($item->body, $item->format, FALSE);
That works for me. You can check the results at my website: American Inventor Spot
Comment #11
deekayen commentedCommitted #10 to DRUPAL-5, DRUPAL-4-7, and DRUPAL-4-6. Yes, I know the furmans version does have redundancy, but atom can't predict what the node_prepare() is going to do when invoking the view hook in a totally different module.
Comment #12
(not verified) commented