ChaiaEran / RuSShdown

Other
10 stars 1 forks source link

[WIP] Use XMLSerializer & DOMParser to read/write feeds #6

Closed vivlim closed 1 month ago

vivlim commented 1 month ago

Refactors the save & load functions to operate on xml documents in memory. I also am wrapping all user-input strings in CDATA sections; otherwise a user could produce a broken feed by writing a post that includes a <.

Also with this change, upon uploading an existing feed file, the first item's author will be used to populate the author field.

I have yet to actually validate the produced xml is valid, though it looks right if I eyeball it. I wanted to share this to get early feedback on my approach and whether you'd like me to keep going with this or not.

ChaiaEran commented 1 month ago

I checked out a quick test deploy, and it looks like it works! RSS Validator read it as valid, and my RSS reader read it fine. About the only suggestion I'd make is if you want to add your name (with a link to your stuff) to the "created by" section. (I also added a Ko-Fi button on my end, so feel free to add something along those lines :P)

vivlim commented 1 month ago

Cool, glad to hear that! I'm away from my computer ATM but I'd like to be credited as "Viv Lim" with a link to https://wp.vivl.im

I was thinking the next thing I'd try is to be able to open a feed and see all of the entries in it once, as well as being able to go back and edit the old ones. I think that'll make it much less likely that someone will need to open the rss feed to make a manual edit themselves.

ChaiaEran commented 1 month ago

Awesome! I added local storage in https://github.com/ChaiaEran/RuSShdown/pull/7, so we just need to resolve the conflict between the new additions and we can merge!

vivlim commented 1 month ago

i'm back at my desk, i'll have a go at resolving the conflict

vivlim commented 1 month ago

Done, it seems to work though I am seeing weird results when I try to open the feed in firefox. namely, the datestamps aren't working. i'll see what happens if i remove cdata from those (it shouldn't be necessary there anyway)

I also added the credit (lmk if you want to change anything about that)

ChaiaEran commented 1 month ago

Datestamps work on my end. I'm gonna merge.