Feature: Add Classic Editor & Standard HTML Support for Post Import/Export (PushMd)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
Push_MD_Plugin から始め、Push_MD_Markdown_Consumer と Push_MD_Markdown_Producer を通るインポート/エクスポートの経路を追跡します。指定された WordPress のエディター検出 API と Push_MD_HTML_Converter の要件を確認します。ブロックエディターの投稿が Gutenberg の動作を維持し、Classic Editor と標準 HTML の投稿がメタデータと書式を含めて両方向に正しく変換されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Overview
Currently, Push MD assumes all WordPress posts use the Gutenberg Block Editor and wraps content in block comments (e.g., <!-- wp:paragraph -->). On sites or post types where the Classic Editor is active (or where Gutenberg is disabled), importing Markdown yields block-comment markup in plain HTML editors, while exporting classic HTML posts is broken and even simple headings and lists do not convert to clean Markdown.
I understand Gutenberg is much cleaner to implement and HTML can be messy. But a lot of people still use Classic Editor or hand coded HTML.
We should support Classic Editor and non-block post types natively during both import (Markdown → HTML) and export (HTML → Markdown).
Note: I've already implemented this and will be sending a PR soon. Creating this issue for reference.
Technical Plan
1. Editor Detection Strategy
- Introduce a helper method
is_block_editor_enabled( $post_type )inPush_MD_Plugin:- Check WordPress core's
use_block_editor_for_post_type( $post_type )when available. - Fall back to checking if
register_block_typeexists. - Provide a filter
push_md_use_block_editorallowing developers to override the decision per post type.
- Check WordPress core's
2. Markdown Consumer Wrapper (Push_MD_Markdown_Consumer)
- Wrap
WordPress\Markdown\MarkdownConsumerto handle classic editor post targets (because we may not want to modify the vendor components):- When block editor is enabled for the target post type: delegate directly to
MarkdownConsumerto return Gutenberg block markup. - When block editor is disabled for the target post type:
- Consume Markdown via
MarkdownConsumer. - Strip Gutenberg block comment wrappers (e.g.,
<!-- wp:... -->and<!-- /wp:... -->). - Remove block-specific CSS classes (
wp-block-*). - Normalize excess blank lines to output clean standard HTML suitable for the Classic Editor.
- Consume Markdown via
- When block editor is enabled for the target post type: delegate directly to
3. Markdown Producer Wrapper (Push_MD_Markdown_Producer)
- Wrap
WordPress\Markdown\MarkdownProducerto handle posts without block markup (because we may not want to modify the vendor components):- Detect whether content contains Gutenberg blocks (
has_blocks( $content )or fallback delimiter check<!-- wp:). - Gutenberg content: Delegate to
MarkdownProducerand normalize the output Markdown. - Classic/Standard HTML content: Extract post metadata into YAML frontmatter and convert standard HTML into clean Markdown.
- Detect whether content contains Gutenberg blocks (
4. HTML to Markdown Converter (Push_MD_HTML_Converter)
- Provide bidirectional conversion and normalization utilities for HTML/Markdown:
- Convert standard HTML tags (headings, paragraphs, lists, links, blockquotes, inline formatting) into idiomatic Markdown.
- Handle list items, line breaks, and paragraph spacing cleanly without redundant blank lines.
- Provide normalization routines for produced Markdown output - for common quirks like extra spaces, non-breaking spaces etc.
- 主要言語
- PHP
- スター
- 22
- フォーク
- 5
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Automattic/php-toolkit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Automattic/php-toolkit#89 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Automattic/php-toolkit#102 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
Automattic/php-toolkit#95 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Automattic/php-toolkit#88 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Automattic/php-toolkit#87 ·
Automattic/php-toolkit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
hector-jewell/food-delivery-system-for-restaurant-using-php#1311 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Sylius/SyliusGridBundle#501 ·