Comments (7)
Micropubs render function: https://github.com/indieweb/wordpress-micropub/blob/trunk/includes/class-micropub-render.php#L16
The 4 verbs at the top are the ones we also support. The rest is best left untouched. May want to replace the gallery shortcode with a block, if applicable.
And offer an option, one way or another, to exclude or include featured images (we could move them before or after e-content
to better reflect how they'd be rendered by certain feed readers) or add u-featured
or u-photo
to them. Although the latter should be a deliberate choice, we can offer users a switch to set this only for, e.g, all Micropub posts that come with a photo.
We might be able to use PHP for this (see https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/blocks/image.php#L16) rather than create a separate block for it. It is also possible to add a class to Image blocks, but this is applied to the figure
element rather than the img
.
from indieblocks.
Supported (the same 4 verbs) Micropub posts are rendered to blocks since 97b784c
Not closing, yet, because of the photo thing.
from indieblocks.
Can add the cite
element to (bookmarks or) reposts.
Re: bookmarks, it'd be kinda hard to detect quoted content vs. "just" remarks. Maybe something–something Markdown. Should probably leave this to site authors/developers.
from indieblocks.
I often use Markdown in my "Micropub posts," which now no longer gets parsed. Used to use Jetpack's Markdown parser for this, but its Markdown block does not work the same way. Or rather, we're merely pushing the Micropub content into a single paragraph block, which is obviously not quite right.
$post_content .= '<!-- wp:group {"className":"e-content"} -->
<div class="wp-block-group e-content"><!-- wp:paragraph -->
<p>' . wp_kses_post( $input['properties']['content'][0] ) . '</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->';
To account for multiple paragraphs and so on, a start would be to instead use the Classic block. Or the Markdown block, if it exists. Or not do anything after all.
from indieblocks.
Jetpack packs an oldish version of https://github.com/michelf/php-markdown (and so does Easy Markdown.
We could include our own version of Markdown Extra (or another flavor, or both), and add a filter (or a setting) to parse content before it is converted into a classic block. Downside is the plain-text, Markdown version is not saved. (The Markdown version is what I use for crossposting to "plain-text" platforms, like Mastodon or Twitter.) Although we could hack something together and save it in post_content_filtered
, which is what Jetpack would do.
from indieblocks.
I often use Markdown in my "Micropub posts," which now no longer gets parsed. Used to use Jetpack's Markdown parser for this, but its Markdown block does not work the same way. Or rather, we're merely pushing the Micropub content into a single paragraph block, which is obviously not quite right.
$post_content .= '<!-- wp:group {"className":"e-content"} --> <div class="wp-block-group e-content"><!-- wp:paragraph --> <p>' . wp_kses_post( $input['properties']['content'][0] ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group -->';
To account for multiple paragraphs and so on, a start would be to instead use the Classic block. Or the Markdown block, if it exists. Or not do anything after all.
Current way forward is to use a Classic block here.
from indieblocks.
Markdown for Micropub posts is now an option. Might one day add a Markdown solution (would almost have to be Markdown block, or a content filter on the front end) for all posts, but that's going to be a different issue. Till then, there's Jetpack, or Easy Markdown if you're on the classic editor.
from indieblocks.
Related Issues (20)
- Keep webmentions open but reject only new posts, after "closing" them? HOT 2
- Create WP-CLI command to store/cache (and delete) images
- Smarter avatar filtering HOT 2
- Add compatibility with rssclub post type
- Look into delete_metadata's $delete_all HOT 1
- Facepile block conflict with Webmention v5.3.0 HOT 4
- CLI command for deleting webmention avatars HOT 2
- Latest Webmention update "kills" IndieBlocks Facepile HOT 13
- Webmention sidebar not showing? HOT 1
- Add CSS support for Webmention's mentions
- Hide Facepile Content block from inserter? HOT 1
- Check for empty page content HOT 1
- Better avatar filenames
- Use avatar subdirs HOT 1
- Facepile "type" argument HOT 4
- Somehow show only like or repost counts HOT 1
- Decode avatar URLs
- Plugin update obscures Gravatar, UI in post-new.php HOT 7
- Webmention deletes
- ActivityPub integration? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from indieblocks.