-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: properly store post content on social media blocks #1753
Conversation
be28e1b
to
91fbe8c
Compare
cfe433d
to
f88d980
Compare
let content = slice | ||
? this.render(slice) | ||
: `<a target="_blank" title="@vogueitalia" href="https://www.tiktok.com/${username}">${username}</a>`; | ||
: `<a target="_blank" title="${username}" href="https://www.tiktok.com/${username}">${username}</a>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
cite: embed.attributes.url, | ||
}).join(" ")}>${this.render(slice)}</blockquote></div>`; | ||
} else { | ||
return `<iframe ${[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not make sense to still render the same structure as the above, just without the <blockquote>
element (or with an empty <blockquote>
element)?
this aligns with React PropTypes boolean naming conventions in cases where the block is being rendered directly to React
As a follow-on to #1685, I'm properly setting the
content
property of social media embeds to the textual content included on them, which allows some basic understanding of what the post was at the time of embedding, which is useful for journalistic reasons.For legibility reasons, I've separated conversions for the HTML source into separate files so there is individual files responsible for testing each annotation.
So for a TwitterEmbed (yes, sorry), we may get an embedded post (below), that was throwing away the textual contents.
Now this will be stored as text on the
content
property: