Cumulus / Syndic

RSS and Atom feed parsing
MIT License
34 stars 13 forks source link

Declare a text_construct type and related function #28

Closed Chris00 closed 10 years ago

Chris00 commented 10 years ago

This small factorization makes it easier to use for other text construct fields if it is deemed necessary.

Chris00 commented 10 years ago

Other text constructs that, at the moment, are parsed as string are atom:rights, atom:subtitle, and atom:title. None of the feeds of the planet use (X)HTML for these so I am not sure one should change... (but it would be more robust).

dinosaure commented 10 years ago

I think in this case, we should either use text_construct or convert with XML.to_string (for avoid to raise an exception).

Chris00 commented 10 years ago

If I follow you well, you mean you would prefer that HTML would be left unparsed? thus the constructor would be Html of string and if the feed does not follow the spec and has structured contend parsed by Xmlm, we convert it back to a string? That's an option I am fine with.

Note that no exception is ever raised. If the conversion fails, [Leaf d] is left untouched.

dinosaure commented 10 years ago

Yes, I think that Syndic does not have to deal with the content, but just the form.

Chris00 commented 10 years ago

That makes sense. I'll change the PR accordingly.

Chris00 commented 10 years ago

What about the 3 other fields?

dinosaure commented 10 years ago

Same as summary with text_construct and Html of string, no ?

Chris00 commented 10 years ago

Yep.