feat: implement minimal server-first markdown processing
Backend implementation: - Add goldmark dependency for markdown processing - Create MarkdownProcessor with minimal config (bold, italic, links only) - Update content injector with HTML injection capabilities - Add injectHTMLContent() for safe DOM manipulation - Server now converts **bold**, *italic*, [links](url) to HTML during enhancement Frontend alignment: - Restrict marked.js to match server capabilities - Disable unsupported features (headings, lists, code blocks, tables) - Update turndown rules to prevent unsupported markdown generation - Frontend editor preview now matches server output exactly Server as source of truth: - Build-time markdown→HTML conversion during enhancement - Zero runtime overhead for end users - Consistent formatting between editor preview and final output - Raw markdown stored in database, HTML served to visitors Tested features: - **bold** → <strong>bold</strong> ✅ - *italic* → <em>italic</em> ✅ - [text](url) → <a href="url">text</a> ✅
This commit is contained in:
@@ -108,7 +108,7 @@ func (e *Enhancer) findAndInjectNodes(rootNode *html.Node, elem parser.Element,
|
||||
}
|
||||
|
||||
// Inject content attributes for the correctly matched node
|
||||
e.injector.addContentAttributes(targetNode, elem.ContentID, string(elem.Type))
|
||||
e.injector.AddContentAttributes(targetNode, elem.ContentID, string(elem.Type))
|
||||
|
||||
// Inject content if available
|
||||
if contentItem != nil {
|
||||
|
||||
Reference in New Issue
Block a user