indieweb / wordpress-micropub

A Micropub Endpoint plugin for WordPress
https://wordpress.org/plugins/micropub
51 stars 12 forks source link

Support HTML content #283

Closed snarfed closed 1 year ago

snarfed commented 1 year ago

Hi @dshanske! I tried to create a post with HTML content just now - https://micropub.spec.indieweb.org/#new-article-with-html - and it didn't work. It escaped the content instead, just like normal. Is HTML content not implemented yet?

{
"h": "entry",
"category": "like",
"name": "...",
"content": {
  "html": "Likes <a class='u-like-of' href='...'>...</a>"
},
"mp-syndicate-to": "bridgy-fed"
}
dshanske commented 1 year ago

It should be https://github.com/indieweb/wordpress-micropub/blob/trunk/includes/class-micropub-endpoint.php#L772

I think it may be one of the WordPress filters. I need to think about which.

snarfed commented 1 year ago

I still feel the pain of this one almost every day. Any idea if this would be an easy fix? Happy to help if I can?

snarfed commented 1 year ago

Turns out this was user error, Micropub requires a JSON request for HTML content. The plugin handles that fine. Sorry! https://micropub.spec.indieweb.org/#new-article-with-html