Support » Plugins and Hacks » Markdown not affecting RSS feed

  • I’m a brand new WordPress user, and love Markdown all to pieces. One thing I’m noticing is that when I activate the Markdown plugin, it only affects posts on the blog; my RSS feed is filled with Markdown markup. That ain’t cool. Is there an easy way to fix that or should I go poke around and see if I can hack it myself?

Viewing 8 replies - 1 through 8 (of 8 total)
  • This works, but it causes the feed to become invalid. For example, in RSS2, the description element doesn’t allow p tags (or ul, etc.) — it expects plain text, not HTML.
    Has anyone come up with a simple solution to this problem? There was a thread on wp-hackers that discusses this problem, but I didn’t see a solution that was agreed upon.
    Thanks.

    I noticed this as well. It was fixed by using full text instead of excerpt only feeds. I’m not entirely sure why, but I am happy.

    Indeed, my solution renders the RSS invalid. I apologize.

    Some kind of HTML stripping filter would do it, no?

    I’ve been experimenting with this for the next release of PHP Markdown and here is what I plan to add:
    add_filter('the_excerpt_rss', 'Markdown', 6);
    add_filter('the_excerpt_rss', 'strip_tags', 100);

    Try it and tell me what do you think.
    — Michel Fortin

    if you edit wp-rss, wp-rss2 and wp-atom you can add <[CDATA[ ….. ]]> around your content and it will validate again.
    the 3 lines in wp-rss.php

    25) <title><![CDATA[<?php the_title_rss() ?>]]></title>
    29) <description><![CDATA[<?php the_excerpt_rss(get_settings('rss_excerp
    t_length'), 2) ?>]]></description>
    and
    33) <description><![CDATA[<?php the_content_rss('', 0, '', get_settings(
    'rss_excerpt_length'), get_settings('rss_encoded_html')) ?>]]></description>

    the 5 lines in wp-rss2.php

    22) <title><![CDATA[<?php the_title_rss() ?>]]></title>
    31) <title><![CDATA[<?php the_title_rss() ?>]]></title>
    38) <description><![CDATA[<?php the_excerpt_rss('', 2) ?>]]></descri
    ption>
    40) <description><![CDATA[<?php the_excerpt_rss(get_settings('rss_ex
    cerpt_length'), 2) ?>]]></description>
    and
    41) <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></co
    ntent:encoded>

    and the 4 lines in wp-atom.php

    18) <title><![CDATA[<?php bloginfo_rss('name') ?>]]></title>
    30) <title><![CDATA[<?php the_title_rss() ?>]]></title>
    36) <summary type="text/html" mode="escaped"><![CDATA[<?php the_exce
    rpt_rss(get_settings('rss_excerpt_length'), 2) ?>]]></summary>
    38) <content type="text/html" mode="escaped" xml:base="<?php permali
    nk_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>

    I really haven’t tested these changes much, but they validated for me and thats where I stopped.
    I am using the enhanced textile2 plugin and had the same problem as you.

    aint line breaks great.

    I also noticed that Markdown isn’t rendered in the excerpts posted as trackbacks. Just for the record.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Markdown not affecting RSS feed’ is closed to new replies.