EDyO / appu

Automatic Podcast Publisher
MIT License
3 stars 2 forks source link

Fix feedupdater to use HTML entities for newlines #44

Closed ifosch closed 2 years ago

ifosch commented 2 years ago

The feedupdater command generates the feed with the entry for the new episode as new_feed.xml.

We use the newline HTML entity (
) to get this shown appropriately, but the XML library it uses, github.com/beevik/etree, is replacing these with regular newline characters (\n) for both the new entry and the old ones. Due to this we need to manually edit the resulting file to include the original feed and replace the new entry newlines with the HTML entity.

We want to avoid this step and have this done correctly. Adjust the README.md document after getting this fixed.

ifosch commented 2 years ago

After some research on the etree library, there is no safe way to do that clean.

One option could be to use the Go's standard library XML encoding library (encoding/xml), but IIRC, this is trouble with the tag's attributes marshalling and unmarshalling operations. Could be worth to give it a try with newer versions.

One other option could be to use a CDATA structure for the text, but this requires checking out this is correctly interpreted by the podcast applications.

ifosch commented 2 years ago

64 addresses this bug by using RSS feed libraries, one for reading and another one for adding new episode and writing the feed.