News aggregator does not interpret HTML character code (e.g <, ", etc) but displays literally.

Is there solution for this or shouldn't the RSS source contains HTML character code any way?

Comments

polar-bear’s picture

I don't know whether this is a Korean encording problem or not but the News Aggregator displays titles like this.

[me] 랑콤 <b>과학</b>연구소 베로니크 델비뉴 박사

i.e. not interpreting <b>.

dman’s picture

Technically, historically, there was no support for RSS to include HTML at all. However various implimentations did so anyway by embedding or encoding it in various non-standard ways.
Various aggregators then have to guess what, if any, encoding was used and then decide how to display it.

Specifically, what is the source site and what is the aggregator software that doesn't seem to be working for you?

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

polar-bear’s picture

Thank you for replying.

Here is the source site:

http://newssearch.naver.com/search.naver?where=rss&query=%B0%FA%C7%D0&qt...

but I do not use other aggregator software so I do not know which software works. However naver.com is the most used search engine in Korea and I am guessing lots of Koreans are using the RSS service without this problem.

slack’s picture

Hi,
I've got the same problem -- a feed which contains HTML markup in the RSS item title, which is being displayed literally. Example:

"Government calls anti-<b>whaling</b> group&#39;s threats stupid"

Can anyone suggest a solution? (I'm using Drupal 5.1 here: http://j17.org/c/aggregator)

--
EOIN DUBSKY

slack’s picture

I've got it. I edited /modules/aggregator/aggregator.module at line 1374 (Drupal 5.1).

From:

$output .= '<h3 class="feed-item-title"><a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a></h3>\n"; // EOIN: changed check_plain($item->title)

To:

$output .= '<h3 class="feed-item-title"><a href="'. check_url($item->link) .'">'. strip_tags($item->title) ."</a></h3>\n"; // EOIN: changed check_plain($item->title)

Basically -- changing "check_plain" to "strip_tags".

--
EOIN DUBSKY

ekrispin’s picture

As the same problem occurs also in the news block, you should do the same change (changing "check_plain" to "strip_tags") also at line 1332 that handles the output of the news item links in the news block.

From:

$output .= '<a target="_blank" href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n";

To:

$output .= '<a target="_blank" href="'. check_url($item->link) .'">'. strip_tags($item->title) ."</a>\n";

----

Erez Krispin