• Resolved Anonymous User 17976131

    (@anonymized-17976131)


    This is less a request to Jetpack devs than to the Jetpack user community. I’m wondering if anyone has any ideas, or even solutions, for wanting to convert all the posts I wrote using the Markdown Block before I disabled Gutenberg into Markdown in Classic Editor posts, so all my content matches under the hood.

    (If you’ve never seen the difference, Markdown Block posts when viewed in the Classic editor start with a section of Markdown wrapped in <!-- wp:jetpack/markdown {"source":"[the markdown]"}--> followed by <div class="wp-block-jetpack-markdown">[the html]</div> whereas Markdown in Classic Editor posts when viewed in the Classic editor just straight-up has the Markdown as written, cleanly.)

    Thanks.

    ETA: Per an earlier post here, I gather that Markdown for Classic Editor stores the Markdown in post_content_filtered and the HTML in post_content, loading the former into the editor when you edit a post. By what I see when I load a Markdown Block post into the Classic Editor, that’s not how things are stored when using Markdown Block. Is there a post_content_filtered on posts written in Markdown Block at all?

    • This topic was modified 1 year, 2 months ago by Anonymous User 17976131.
    • This topic was modified 1 year, 2 months ago by Anonymous User 17976131.
    • This topic was modified 1 year, 2 months ago by Anonymous User 17976131.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Animesh Gaurav (a11n)

    (@bizanimesh)

    Hello @bixfrankonis – I was wondering, you may ask this question in the WordPress forum here. With block, that’s how we can process it but you may get more ideas there

    Thread Starter Anonymous User 17976131

    (@anonymized-17976131)

    Can I get a re-confirmation on how things are stored again? Because I’ve been trying this conversion and I had questions.

    Unless I got lost along the way, my understanding is that for Markdown Block posts everything is stored in post_content, meaning the funky wrapper on the Markdown and then the HTML generated from it. But for Markdown in the Classic Editor posts, I was told that the Markdown as written is stored in post_content_filtered while the HTML generated from it is stored in post_content.

    If I have Jetpack installed, and Write posts or pages in plain-text Markdown syntax on, when going to an existing post that was Markdown in the Classic Editor, the editor should load the content from post_content_filtered, yes?

    Here’s where I am stuck: I am testing things on a local MAMP install, and I do have Jetpack installed but of course it’s in Offline Mode because I’m on my laptop. Does the Markdown setting work in Offline Mode? Because when I look at a post that I’ve converted from Markdown Block to Markdown in the Classic Editor—such that post_content_filtered has the markdown, the editor is loading…the HTML.

    What am I missing here?

    Thanks.

    Thread Starter Anonymous User 17976131

    (@anonymized-17976131)

    Apparently what I was missing was the addition of some post_meta, namely a _wpcom_is_markdown key with a value of 1.

    Thread Starter Anonymous User 17976131

    (@anonymized-17976131)

    For what it’s worth here is the last thing needed to make the entire process work like a charm.

    Thread Starter Anonymous User 17976131

    (@anonymized-17976131)

    Okay, so ChatGPT and I solved this today. If anyone’s ever interested, it involved first running this PHP script to decode the Unicode in Markdown Block posts so the Markdown was human-readable like Markdown in the Classic Editor posts, and then running these database queries to add some post_meta I didn’t know about until today and then put Markdown in post_content_filtered and HTML in post_content. As near as I can tell, nothing has gone wrong.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Convert posts using Markdown Block to Markdown in Classic Editor posts?’ is closed to new replies.