Skip to content

Fix q=source to return valid MF2 JSON for all properties#312

Merged
pfefferle merged 1 commit intotrunkfrom
fix/242-mf2-json-properties
Jan 11, 2026
Merged

Fix q=source to return valid MF2 JSON for all properties#312
pfefferle merged 1 commit intotrunkfrom
fix/242-mf2-json-properties

Conversation

@pfefferle
Copy link
Copy Markdown
Member

Summary

  • Ensures all MF2 property values are arrays as required by the MF2 spec
  • Skips empty string values which indicate unset properties
  • Wraps non-array values in arrays

Fixes #242

Copy link
Copy Markdown

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 fixes the micropub_get_mf2() function to ensure all MF2 property values are returned as arrays, as required by the Microformats2 specification. This addresses issue #242 where the q=source query was returning non-compliant MF2 JSON for certain properties.

Changes:

  • Added validation to skip empty string values from post meta, as they indicate unset properties
  • Added logic to wrap non-array values in arrays to ensure MF2 compliance
  • Ensures consistent array structure for all MF2 properties retrieved from post meta

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

@pfefferle pfefferle self-assigned this Jan 11, 2026
Copy link
Copy Markdown
Member

@dshanske dshanske left a comment

Choose a reason for hiding this comment

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

Looks good to me

Ensure all MF2 property values are arrays as required by the spec.
Skip empty string values (unset properties) and wrap non-array
values in arrays.

Fixes #242
@pfefferle pfefferle force-pushed the fix/242-mf2-json-properties branch from 495e0cb to dddd70d Compare January 11, 2026 21:44
@pfefferle pfefferle merged commit 36b541c into trunk Jan 11, 2026
8 checks passed
@pfefferle pfefferle deleted the fix/242-mf2-json-properties branch January 11, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

q=source is not returning valid MF2 JSON for empty properties

3 participants