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

Add images from WebMention? #365

Open
edent opened this issue Apr 6, 2023 · 3 comments
Open

Add images from WebMention? #365

edent opened this issue Apr 6, 2023 · 3 comments
Labels

Comments

@edent
Copy link
Contributor

edent commented Apr 6, 2023

I've received a pingback from https://brid.gy/comment/mastodon/@edent@mastodon.social/110151657347210229/110151774995722710

The plugin gets the author's name, URL, avatar, and text content. It doesn't include the image along with the post.

Sometimes, people reply with only an image. Or their reply references an attached image. It would be useful to include this as part of the webmention.

The HTML code is:

<span class="p-author h-card">
   <a class="p-name u-url" href="https://mastodon.social/@Edent">Terence Eden</a>
   <a class="u-url" href="https://edent.tel/"></a>
   <a class="u-url" href="https://shkspr.mobi/blog"></a>
   <span class="p-nickname">Edent</span>
   <img class="u-photo" src="https://files.mastodon.social/accounts/avatars/000/007/112/original/37df032a5951b96c.jpg" alt="" />
</span>
<a title="mastodon.social/@Edent/110151774995722710" class="u-url" href="https://mastodon.social/@Edent/110151774995722710">mastodon.social/@Edent/1101517...</a>
<div class="e-content p-name">
   <p>Incidentally, this was my favourite comment when I announced I was doing an MSc.</p><p>The rage it induced powered me through many a tutorial!</p>
</div>
<img class="u-photo" src="https://files.mastodon.social/media_attachments/files/110/151/771/251/554/330/original/a80cc6cfe970ec56.png" alt="" />


@pfefferle
Copy link
Owner

It is because WordPress Core does not allow Images in Posts. We should discuss if we should overrule this for Webmentions.

@dshanske
Copy link
Collaborator

I'm also a bit worried about automatically doing this. Might need to pair it with some new moderation settings. I wanted to revisit moderation anyway.

@edent
Copy link
Contributor Author

edent commented Nov 29, 2023

Just a bump on this. If I want images to appear in webmentions, do I just need to tell my theme to allow <img> in comments - or is there also something in the plugin filtering them out?

Background

Some of my mentions contain images. Without those images, the comments look really weird.

Example:

<article class="h-entry">
  <span class="p-uid">at://did:plc:5jl75t6lnqg2h5ciuglcwca6/app.bsky.feed.post/3kfcirl4jqv2g</span>
  
  <time class="dt-published" datetime="2023-11-29T05:19:48.073000+00:00">2023-11-29T05:19:48.073000+00:00</time>
  
  <span class="p-author h-card">
    <data class="p-uid" value="did:plc:5jl75t6lnqg2h5ciuglcwca6"></data>
    <a class="p-name u-url" href="https://bsky.app/profile/anniecrab.bsky.social">Annie</a>
    <span class="p-nickname">anniecrab.bsky.social</span>
    <img class="u-photo" src="https://cdn.bsky.app/img/avatar/plain/did:plc:5jl75t6lnqg2h5ciuglcwca6/bafkreibf2yo6gjqyouc7ynr2rogbqdeoxk5rue4hpzn2eyjwodmpahxpoa@jpeg" alt="" />
  </span>

  <a title="bsky.app/profile/anniecrab.bsky.social/post/3kfcirl4jqv2g" class="u-url" href="https://bsky.app/profile/anniecrab.bsky.social/post/3kfcirl4jqv2g">bsky.app/profile/anniec...</a>
  <div class="e-content p-name">
  
  Except now they’ve started doing really absurd things like this.
  </div>
<img class="u-photo" src="https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:5jl75t6lnqg2h5ciuglcwca6/bafkreihq5g3khh6cncnjtwskpxuh52t5x2gw4vru4wjb22sfi3aeblpfwm@jpeg" alt="A captcha challenge. ‘Please select all images of one type that appear colder in comparison to other images.’ The images are variously of snowmen, living room sofas and conference rooms." />

  <a class="u-in-reply-to" href="https://bsky.app/profile/did:plc:dip7ueksh627fxacagfrdyz2/post/3kf5rgltyst2h"></a>
  <a class="u-in-reply-to" href="https://shkspr.mobi/blog/2017/11/captchas-dont-prove-youre-human-they-prove-youre-american/"></a>

</article>

Without the img and alt, the comment looks weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants