Giter VIP home page Giter VIP logo

Comments (7)

janboddez avatar janboddez commented on August 18, 2024

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.

janboddez avatar janboddez commented on August 18, 2024

Supported (the same 4 verbs) Micropub posts are rendered to blocks since 97b784c

Not closing, yet, because of the photo thing.

from indieblocks.

janboddez avatar janboddez commented on August 18, 2024

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.

janboddez avatar janboddez commented on August 18, 2024

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.

janboddez avatar janboddez commented on August 18, 2024

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.

janboddez avatar janboddez commented on August 18, 2024

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.

janboddez avatar janboddez commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.