Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Feed entries are not formatted like Atom entries #148

Closed
bdesham opened this issue May 17, 2018 · 2 comments
Closed

JSON Feed entries are not formatted like Atom entries #148

bdesham opened this issue May 17, 2018 · 2 comments

Comments

@bdesham
Copy link
Contributor

bdesham commented May 17, 2018

(This is along the same lines as #146.)

When Granary turns Instagram posts into Atom entries, it’s smart about converting \n\n to <p> tags, hyperlinking usernames, and so on. Right now it seems that this kind of processing is not being done for JSON Feeds. I think Granary should put the same value in a JSON Feed’s content_html that it would have put in an Atom feed’s content.

I’d be willing to work on a patch for this (although I don’t have a ton of time in which to do so). What do you think is the best architectural approach to be able to specify the AS-to-HTML conversion in just one place?

@snarfed
Copy link
Owner

snarfed commented May 17, 2018

hey @bdesham, thanks for volunteering for this! this should actually be pretty easy, and is maybe just an embarrassing oversight. the hard work should already be extracted out and available in microformats2.render_content, you may just need to call that in jsonfeed. example usage in atom.py (but no need to escape &s in json feed):

https://github.com/snarfed/granary/blob/master/granary/atom.py#L358-L360

most of the work may actually end up just updating the tests. :P

@snarfed
Copy link
Owner

snarfed commented Jul 16, 2018

thanks again @bdesham!

@snarfed snarfed closed this as completed Jul 16, 2018
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

No branches or pull requests

2 participants