mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Pre-process section types for HTML export
This commit is contained in:
parent
b7fa4e1a1a
commit
4949043df9
1 changed files with 7 additions and 2 deletions
|
@ -230,7 +230,6 @@ func exportDocument(ctx domain.RequestContext, s domain.Store, spaceID string, d
|
|||
// Turn each document into TOC entry and HTML content export
|
||||
b := strings.Builder{}
|
||||
for _, documentID := range document {
|
||||
fmt.Println(documentID)
|
||||
for _, d := range docs {
|
||||
if d.RefID == documentID {
|
||||
if permission.CanViewDocument(ctx, s, d.RefID) {
|
||||
|
@ -309,9 +308,15 @@ func processDocument(ctx domain.RequestContext, s domain.Store, documentID strin
|
|||
b.WriteString("</div>")
|
||||
b.WriteString("</div>")
|
||||
|
||||
// Process seciton content before writing out as HTML.
|
||||
section := page.Body
|
||||
if page.ContentType == "plantuml" {
|
||||
section = fmt.Sprintf(`<img src="%s" />`, page.Body)
|
||||
}
|
||||
|
||||
// Write out section content
|
||||
b.WriteString(`<div class="wysiwyg">`)
|
||||
b.WriteString(page.Body)
|
||||
b.WriteString(section)
|
||||
b.WriteString("</div>")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue