diff --git a/library/text/parser/feed/src/atom/atom_feed_generator.e b/library/text/parser/feed/src/atom/atom_feed_generator.e index f4d87916..92925132 100644 --- a/library/text/parser/feed/src/atom/atom_feed_generator.e +++ b/library/text/parser/feed/src/atom/atom_feed_generator.e @@ -83,13 +83,9 @@ feature -- Visitor append_content_tag_to ("summary", Void, a_entry.description, buffer) if attached a_entry.content as l_content then if attached a_entry.content_type_or_default ("xhtml").is_case_insensitive_equal_general ("xhtml") then --- if l_content.has_substring ("
") then - append_content_tag_to ("content", <<["type", "xhtml"]>>, l_content, buffer) --- else --- append_content_tag_to ("content", <<["type", "xhtml"]>>, {STRING_32} "
" + l_content + {STRING_32} "
", buffer) --- end + append_content_tag_to ("content", <<["type", "xhtml"]>>, l_content, buffer) else - append_content_tag_to ("content", <<["type", a_entry.content_type]>>, a_entry.content, buffer) + append_content_tag_to ("content", <<["type", a_entry.content_type]>>, l_content, buffer) end end diff --git a/library/text/parser/feed/src/kernel/feed.e b/library/text/parser/feed/src/kernel/feed.e index 7d60d8b2..d012078d 100644 --- a/library/text/parser/feed/src/kernel/feed.e +++ b/library/text/parser/feed/src/kernel/feed.e @@ -138,6 +138,18 @@ feature -- Element change Result.sort end + set_link (a_url: READABLE_STRING_8; rel: detachable READABLE_STRING_GENERAL) + -- Set link `a_url` for relation `rel`. + local + lnk: FEED_LINK + do + create lnk.make (a_url) + if rel /= Void then + lnk.set_relation (rel) + end + links.force (lnk, lnk.relation) + end + sort -- Sort `items', (recent first). local diff --git a/library/text/parser/feed/src/rss/rss_2_feed_generator.e b/library/text/parser/feed/src/rss/rss_2_feed_generator.e index 2c008620..2481a534 100644 --- a/library/text/parser/feed/src/rss/rss_2_feed_generator.e +++ b/library/text/parser/feed/src/rss/rss_2_feed_generator.e @@ -33,7 +33,11 @@ feature -- Visitor indent indent append_content_tag_to ("title", Void, a_feed.title, buffer) - append_content_tag_to ("description", Void, a_feed.description, buffer) + if attached a_feed.description as desc then + append_content_tag_to ("description", Void, desc, buffer) + else + append_content_tag_to ("description", Void, a_feed.title, buffer) + end across a_feed.links as tb loop @@ -120,7 +124,7 @@ feature {NONE} -- Helpers htdate: HTTP_DATE do create htdate.make_from_date_time (dt) - Result := htdate.rfc850_string + Result := htdate.rfc1123_string end end diff --git a/library/text/parser/feed/src/support/feed_generator.e b/library/text/parser/feed/src/support/feed_generator.e index cad90cc0..a913d1e9 100644 --- a/library/text/parser/feed/src/support/feed_generator.e +++ b/library/text/parser/feed/src/support/feed_generator.e @@ -46,6 +46,8 @@ feature {NONE} -- Helpers indentation: STRING append_content_tag_to (a_tagname: READABLE_STRING_8; a_attr: detachable ITERABLE [TUPLE [name: READABLE_STRING_8; value: detachable READABLE_STRING_GENERAL]]; a_content: detachable READABLE_STRING_GENERAL; a_output: STRING) + local + l_is_xhtml_type: BOOLEAN do if a_content /= Void or a_attr /= Void then a_output.append (indentation) @@ -60,8 +62,11 @@ feature {NONE} -- Helpers a_output.append (ic.item.name) a_output.append_character ('=') a_output.append_character ('%"') - a_output.append (escaped_unicode_xml (l_att_value.as_string_32)) + a_output.append (escaped_xml (l_att_value)) a_output.append_character ('%"') + if ic.item.name.same_string ("type") and then l_att_value.same_string ("xhtml") then + l_is_xhtml_type := True + end end end end @@ -69,7 +74,13 @@ feature {NONE} -- Helpers a_output.append ("/>%N") else a_output.append (">") - a_output.append (escaped_unicode_xml (a_content.as_string_32)) + if l_is_xhtml_type then + a_output.append ("
") + a_output.append (escaped_xml (a_content)) + a_output.append ("
") + else + a_output.append (escaped_xml (a_content)) + end a_output.append ("%N") end end @@ -89,7 +100,7 @@ feature {NONE} -- Helpers a_output.append (ic.item.name) a_output.append_character ('=') a_output.append_character ('%"') - a_output.append (escaped_unicode_xml (ic.item.value)) + a_output.append (escaped_xml (ic.item.value)) a_output.append_character ('%"') end end diff --git a/library/text/parser/feed/src/support/feed_parser_utilities.e b/library/text/parser/feed/src/support/feed_parser_utilities.e index 1f38c1e2..8a89f8ee 100644 --- a/library/text/parser/feed/src/support/feed_parser_utilities.e +++ b/library/text/parser/feed/src/support/feed_parser_utilities.e @@ -50,7 +50,7 @@ feature -- Access if attached xml_attribute_text (x_link, "href") as l_href and then l_href.is_valid_as_string_8 then - create lnk.make (l_href.as_string_8) + create lnk.make (l_href.to_string_8) lnk.set_relation (xml_attribute_text (x_link, "rel")) lnk.set_type (xml_attribute_text (x_link, "type")) Result.force (lnk)