feat(ext-blog): Add rich Markdown editor for blog posts

Replace the plain textarea with a CodeMirror-based editor supporting syntax highlighting, formatting toolbar (bold, italic, lists, code blocks), and a live preview toggle. Update PostContentRenderer to handle new Markdown syntax (blockquotes, fenced code blocks). Add a preview endpoint for rendering content without saving.
This commit is contained in:
2026-12-02 10:20:36 +00:00
parent e97d96c1f5
commit 2d4b196b04
17 changed files with 1127 additions and 38 deletions
+8
View File
@@ -13,10 +13,13 @@ const GRAPES_JS_PATH = path.resolve(__dirname, 'node_modules/grapesjs/dist/grape
const GRAPES_CSS_PATH = path.resolve(__dirname, 'node_modules/grapesjs/dist/css/grapes.min.css');
const DIST_DIR = path.resolve(__dirname, 'dist');
const DIST_PB_DIR = path.resolve(DIST_DIR, 'pagebuilder');
const BLOG_EDITOR_SOURCE = path.resolve(__dirname, '../extensions/plugi-ext-blog/admin/assets/src/markdown-editor.js');
const BLOG_EDITOR_OUTPUT = path.resolve(__dirname, '../extensions/plugi-ext-blog/admin/assets/markdown-editor.js');
function ensureDirectories() {
fs.mkdirSync(DIST_DIR, { recursive: true });
fs.mkdirSync(DIST_PB_DIR, { recursive: true });
fs.mkdirSync(path.dirname(BLOG_EDITOR_OUTPUT), { recursive: true });
}
function verifyPreconditions() {
@@ -163,6 +166,10 @@ async function buildWebsiteManagerJs() {
);
}
async function buildBlogMarkdownEditor() {
await bundleJs(BLOG_EDITOR_SOURCE, BLOG_EDITOR_OUTPUT, { minify: !isDev });
}
function runTailwindCli({
watch = false,
input = path.resolve(__dirname, 'src/Modules/WebsiteManager/resources/assets/css/style.css'),
@@ -217,6 +224,7 @@ async function buildAll() {
await Promise.all([
buildWebsiteManagerJs(),
buildBlogMarkdownEditor(),
runTailwindCli({ watch: false }),
runTailwindCli({
watch: false,