mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-23 07:24:07 +01:00
🎨 Markdown syntax switch no longer affects clip/paste HTML parsing https://github.com/siyuan-note/siyuan/issues/11604
This commit is contained in:
parent
505cf51efe
commit
7c6ff6b55f
6 changed files with 14 additions and 12 deletions
|
|
@ -22,6 +22,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/88250/lute"
|
||||
"image"
|
||||
"image/jpeg"
|
||||
"image/png"
|
||||
|
|
@ -54,9 +55,8 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func HTML2Markdown(htmlStr string) (markdown string, withMath bool, err error) {
|
||||
func HTML2Markdown(htmlStr string, luteEngine *lute.Lute) (markdown string, withMath bool, err error) {
|
||||
assetDirPath := filepath.Join(util.DataDir, "assets")
|
||||
luteEngine := util.NewLute()
|
||||
tree := luteEngine.HTML2Tree(htmlStr)
|
||||
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
if !entering {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue