-
Notifications
You must be signed in to change notification settings - Fork 35
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
Inconsistent blockquote use in legacy /posts "body" field #36
Comments
this odd behaviour can also be observed on themes that don't use this isn't exactly helpful, but i wanted to add that this is an observable issue even without directly interacting with the API! it's a very strange problem considering it happens so inconsistently. |
I filed this as a bug with Tumblr support about a year ago, and IIRC it's been happening pretty consistently since September 2019. There's something about the code that turns new NPF reblogs into the legacy HTML format that's just entirely broken. Posts made on desktop seem to be immune—afaict, this only happens with reblogs originated in NPF, like the ones produced by the mobile app. In case a Tumblr engineer wants to take a look, the ticket number I have is 7593494 on Zendesk. |
Hello! Great questions. A lot of the answers here are loaded behind this note in the API docs:
Specifically, these days, this part is doing a lot of work: "maintain backwards compatibility" (when
Simply put, posts created via the new format don't use the legacy blockquote-based HTML storage approach. We do a best effort to maintain backwards compatibility, so that you can still use
Totally! We'll work to make this clearer. 👌
Yeah I remember this being filed and I thought we had fixed it, but since it seems like we haven't, I'll see if I can reopen the issue. However, long story short here is that the conversion of NPF posts to HTML is "best effort", and there are some weird edge cases. We'll keep trying to do a best effort conversion on our side, but all API consumers should move to leveraging NPF JSON if they can. |
@cyle I appreciate that API consumers should migrate where possible, but it seems impractical to ask every pre-2019 theme author to migrate, and this problem is only going to become more prevalent as the new web dashboard moves to making NPF native posts and reblogs. Understandably, not everything that is possible with NPF is going to be feasible to maintain backwards compatibility for, but the reblog trail seem like a pretty fundamental feature 😅
I believe the fix implemented at the time only worked for 1-paragraph reblogs, multi paragraph reblogs still have the same problem. |
Agreed, which is why my comments are limited to API consumers, and not themes. The blog network is a different set of expectations, and we'll maintain backwards compatibility there for the foreseeable future. That being broken is a bug that we should fix. |
I've added a blurb to the API docs about this API-wise. As for the reblog layout bug, it's on our radar, hopefully soon you'll see a note on the Changes blog when we've fixed it. I'll see if we can reopen your specific ticket @nightpool Thanks! 😄 |
I am using the tumblr API, specifically the
/posts
endpoint withnpf=false
. I am using pytumblr.One of the fields in the response is called
body
and contains HTML. Reblog chains are represented with nested blockquotes, like the way the dashboard used to look a long time ago.I sometimes encounter posts where the nested blockquotes in
body
don't correctly convey the structure of the reblog chain.I am wondering
body
and treatingtrail
(together withanswer
etc. when applicable) as the source of truth.trail
should be preferred overbody
, it would be nice to see this called out.trail
.If this is simply an inherent problem with legacy format, and the recommended mitigation is to use NPF for post consumption, then it would be nice to add this recommendation to the docs.
An example of the behavior is
https://ofthefog.tumblr.com/post/625973088048300032/i-eat-things-by-breaking-off-small-chunks-and
which is a three-post reblog chain, with a post by ofthefog, then a response by facelessoldgargoyle, and then a response by ofthefog.
If I request this post with a pytumblr client
client
, by callingpost = client.posts('ofthefog', id=625973088048300032)['posts'][0]
then
post['body']
contains the following:This splits facelessoldgargoyle's post in two, with ofthefog's first post appearing between one paragraph and another one. I'll have github render the same HTML below, to make this visible:
facelessoldgargoyle:
I eat things by breaking off small chunks and chewing. I became full, so I stopped.
I am given to understand this is normal.
I just like bones. They usually have tasty insides, but the outside makes me have very strong bones. Same with eggshells and horns.
My body is not the crust so it cannot be reconstructed with human hands.
The text was updated successfully, but these errors were encountered: