-
Notifications
You must be signed in to change notification settings - Fork 0
EDITOR.md
Jason Brain edited this page Jan 10, 2026
·
1 revision
We have chosen Editor.js as the content editor for Core CMS.
- Clean Data: It saves content as structured JSON, not messy HTML blobs. This makes it API-ready and AI-friendly.
- Modern UI: Block-based editing is the industry standard (Notion, WordPress Gutenberg).
-
Markdown Support: It supports "Markdown Shortcuts" (typing
#auto-converts to a Header), satisfying power users.
- The
poststable'spost_contentcolumn (LONGTEXT) will store the JSON string.
- We replace the
<textarea>inadmin/post-edit.phpwith the Editor.js UI. - On form submit, JavaScript serializes the blocks to JSON and puts it into a hidden input field.
- We need a PHP helper function
render_content($json)inincludes/functions.php. - This function iterates through the JSON blocks and outputs semantic HTML (
<h1>,<p>,<img>).
The user requested a "Markdown Block".
- Native: Editor.js handles standard Markdown syntax (headers, lists, bold, code) via auto-conversion.
-
Raw HTML/Markdown: We can include the
Rawtool for pasting pure HTML or Markdown snippets if needed.
- Assets: Download/Link Editor.js and essential tools (Header, List, Image, Quote).
-
Admin UI: Update
admin/post-edit.php. - Renderer: Create the PHP rendering logic.