Phase 1: Fix markdown rendering
- Add rawHTML helper function using template.HTML()
- Update docs template to use { template.HTML(doc.Content) }
- Docs now render HTML headings and content properly
- Markdown is converted to HTML by goldmark (with Unsafe()) and output directly
This commit is contained in:
@@ -5,10 +5,6 @@ import (
|
||||
"html/template"
|
||||
)
|
||||
|
||||
templ rawHTML(content string) {
|
||||
{ template.HTML(content) }
|
||||
}
|
||||
|
||||
templ DocsLayout(nav Navigation, doc Document, user User) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -242,7 +238,7 @@ templ DocsLayout(nav Navigation, doc Document, user User) {
|
||||
|
||||
<!-- Content -->
|
||||
<div>
|
||||
@rawHTML(doc.Content)
|
||||
{ doc.Content }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user