Skip to content

CDATA support for RSS description was added - #36

Closed
woxcab wants to merge 1 commit into
lkiesow:masterfrom
woxcab:master
Closed

woxcab wants to merge 1 commit into
lkiesow:masterfrom
woxcab:master

Conversation

@woxcab

@woxcab woxcab commented Dec 28, 2015

Copy link
Copy Markdown

RSS allows to use CDATA blocks (proof), so I offer to add the optional parameter type to the description() function (as in content()).

@lkiesow

lkiesow commented Jan 1, 2016

Copy link
Copy Markdown
Owner

Hi woxcab,
I am hesitant to merge this because of the related ATOM text fields which also have an attribute called type which has another meaning entirely. This attribute is not supported in feedgen yet but it it will ever be added, things might get really confusing.

My suggestion would be to just name the argument cdata which would be a not so nice quick fix which I nevertheless would accept since it should not harm.

Since all the ATOM text fields and probably also some other RSS fields (not sure about that; would have to check) also may contain CDATA, and could have the ATOM types linked above, a proper way would be to add a new text type class, supporting CDATA as well as the different types possible for these fields (and possibly even do the encoding?). But I fear that I do not have the time to implement that in the near future.

Please let me know if you disagree.

Regards,
Lars

@woxcab

woxcab commented Jan 2, 2016

Copy link
Copy Markdown
Author

Hi Lars.

What do you mean by text type class in the context of Python language? Metaclasses?

@lkiesow

lkiesow commented Jan 2, 2016

Copy link
Copy Markdown
Owner

There are several fields in ATOM (e.g title, summary, content, and rights) (and I suspect also in RSS feeds) which could have CDATA entries as well as having several different content types like text or xhtml.

One possible way to handle this is to add support for this to every field, using a dictionary. This is basically what this patch is doing, though for one RSS field only. A differnt idea would be to add a general Python class to handle all this. It would still be necessary to add the arguments to all the setter functions but we would have a similar handling of content for these fields. I would add a cdata field as well as the type field taken from the ATOM specs. Possibly, even an optional autoencoding property could be added which would then ensure that HTML/XML entities are encoded if necessary, …

But that is obviously a bit more work and I suspect that I will not find the time in the near future to do this. That is why I said that I would accept this patch with only the argument name changed so that it does not get confused with the ATOM type attribute if it is added at some point. You should not suffer from my lack of time ;-P And if at some point I have the time to work on this, the cdata argument could still be used.

@woxcab

woxcab commented Jan 2, 2016

Copy link
Copy Markdown
Author

Oh. I cannot imagine implementation details for class-based way, so I abstain from this.
P.S. CDATA possibly can be used only for description in the RSS (e.g. cannot be used for title, if believe to w3c validator).

@mtreinish

mtreinish commented Apr 20, 2016 •

Copy link
Copy Markdown

Is there any update on this? If not I can respin the patch to adjust based on ikiesow's comments.

@woxcab woxcab closed this Aug 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants