|
@@ -20,6 +20,7 @@ import (
|
|
"bytes"
|
|
"bytes"
|
|
"errors"
|
|
"errors"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "github.com/88250/lute/render"
|
|
"strconv"
|
|
"strconv"
|
|
"strings"
|
|
"strings"
|
|
"time"
|
|
"time"
|
|
@@ -617,7 +618,7 @@ func GetBlockDOM(id string) (ret string) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func GetBlockKramdown(id string) (ret string) {
|
|
|
|
|
|
+func GetBlockKramdown(id, mode string) (ret string) {
|
|
if "" == id {
|
|
if "" == id {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -633,7 +634,13 @@ func GetBlockKramdown(id string) (ret string) {
|
|
root.AppendChild(node.Next) // IAL
|
|
root.AppendChild(node.Next) // IAL
|
|
root.PrependChild(node)
|
|
root.PrependChild(node)
|
|
luteEngine := NewLute()
|
|
luteEngine := NewLute()
|
|
- ret = treenode.ExportNodeStdMd(root, luteEngine)
|
|
|
|
|
|
+ if "md" == mode {
|
|
|
|
+ ret = treenode.ExportNodeStdMd(root, luteEngine)
|
|
|
|
+ } else {
|
|
|
|
+ tree.Root = root
|
|
|
|
+ formatRenderer := render.NewFormatRenderer(tree, luteEngine.RenderOptions)
|
|
|
|
+ ret = string(formatRenderer.Render())
|
|
|
|
+ }
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|