Opened 12 years ago
Last modified 4 years ago
#21753 new defect (bug)
Feed excerpts are missing important filter formatting
Reported by: | mdgl | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4.1 |
Component: | Feeds | Keywords: | has-patch needs-testing needs-unit-tests |
Focuses: | Cc: |
Description
Excerpts included in feeds are missing important formatting because the relevant filters are not applied (e.g. wpautop).
In file wp-includes/feed.php, function the_excerpt_rss() does not apply the same filters as the_excerpt() whilst results in lost formatting instructions. By comparison, function the_content_feed() ensures that the same filters declared for the_content() are applied.
A suggested patch is attached. Note that for symmetry between the_excerpt_rss() and the_content_feed() this patch also removes the (unnecessary?) filter ent2ncr() from the_excerpt_rss() and retains the (controversial?) escaping for CDATA blocks (see #3670).
A few related issues are worth mentioning. Firstly, shortcodes are still not applied to excerpts (see #7093). Also, the (obsolete?) RDF feed does not make use of a CDATA block unlike those for RSS, RSS2 and Atom (see #20888). Finally, a similar problem occurs with comment text in feeds (see #16466).
Attachments (3)
Change History (10)
#2
@
11 years ago
Patch refreshed for trunk. Earlier caveats still apply. It remains both surprising and disappointing that WordPress doesn't have a clean and consistent way of dealing with fundamental concepts such as the_content and the_excerpt. We mess with this stuff far too much and in different ways.
This ticket was mentioned in IRC in #wordpress-dev by raamdev. View the logs.
11 years ago
#4
@
11 years ago
- Keywords has-patch needs-testing added; needs-refresh removed
@mdgl Thank you for the updated patch. I've confirmed that it applies cleanly to trunk.
@mdgl Thanks for the report. I'm sorry that you never got a reply on this!
I tried testing your patch but it did not apply cleanly for me. Could you please submit an updated patch?