Added language-specific syntax highlighting support to the markdown editor and preview. New code-highlighter assets are registered for public pages and admin headers. The PostContentRenderer detects language identifiers in code fences to apply appropriate CSS classes for highlighting. Tests verify the highlighting works correctly and unsafe content is escaped properly.
17 lines
454 B
JavaScript
17 lines
454 B
JavaScript
import { rolldown } from 'rolldown';
|
|
|
|
const bundle = await rolldown({ input: 'admin/assets/src/markdown-editor.js' });
|
|
await bundle.write({
|
|
file: 'admin/assets/markdown-editor.js',
|
|
format: 'iife',
|
|
sourcemap: true,
|
|
minify: true,
|
|
});
|
|
|
|
const highlighterBundle = await rolldown({ input: 'assets/src/code-highlighter.js' });
|
|
await highlighterBundle.write({
|
|
file: 'assets/code-highlighter.js',
|
|
format: 'iife',
|
|
sourcemap: true,
|
|
minify: true,
|
|
}); |