lkiesow / python-feedgen

Python module to generate ATOM feeds, RSS feeds and Podcasts.
https://feedgen.kiesow.be/
BSD 2-Clause "Simplified" License
713 stars 123 forks source link

How can I add multiple lines into description #120

Closed sitereliabilityengineer closed 7 months ago

sitereliabilityengineer commented 1 year ago

Hello, this is my first message here.

I'm trying to add multiple lines to the description but it's not working. I've tried with

, with < ! [ CDATA[Hi Rss feed
Here is new line ]]>

But it's not showing multiple lines. Is this an issue from my reader or I might be doing it wrong ?

Thank you so much.

lkiesow commented 7 months ago

Writing something like:

fg.subtitle('This is a\nmultiline\n\ndescription')

will result in a multiline output like this:

<description>This is a
multiline

description</description>

But iirc RSS has no type specification for the description field. So, it is up to the RSS reader to interpret and display this. Some may accept HTML in these fields, but that may also mean that the reader will just display the HTML code. I don't think we can really do much about that.

The Atom equivalent subtitle seems to support a type attribute which may help. But I have no idea if Atom is an option. Also, that would require a (relatively simple) patch to feedgen.