Skip to content

Conversation

@pfefferle
Copy link
Owner

Summary

  • Extract video/audio URLs as link content when no text content property exists
  • Use registered comment type excerpt templates (e.g., "liked this") as fallback for reactions (likes, reposts, etc.) that have no content

Fixes #438

Test Plan

  • Test with Bridgy video-only webmention (like https://brid.gy/comment/bluesky/...)
  • Test with Bridgy like/repost webmentions
  • Verify existing webmentions with text content still work correctly

- Extract video/audio URLs as link content when no text content exists
- Use registered comment type excerpt templates as fallback for
  reactions (likes, reposts, etc.)
- Add video-reply test fixture

Fixes #438
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds fallback mechanisms for webmentions that lack text content, specifically targeting Bridgy webmentions. It implements two fallback strategies: extracting video/audio URLs as clickable links when no content property exists, and using registered comment type excerpt templates (e.g., "liked this", "reposted this") for reaction-type webmentions.

Key changes:

  • Video/audio URL extraction as fallback content in the MF2 handler
  • Comment type excerpt template fallback in the Item entity's get_content() method

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/data/mf2/video-reply.html Test fixture HTML for video-only webmention with microformats markup
tests/data/mf2/video-reply.json Expected test output showing video URL as content
readme.md Changelog entries documenting the new fallback features
includes/Handler/class-mf2.php Video/audio URL extraction logic with proper URL validation and escaping
includes/Entity/class-item.php Excerpt template fallback method that generates content from comment type templates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Bridgy Webmentions Set Content to Bridgy Response

2 participants