This commit is contained in:
Liang Ding 2022-09-14 00:35:13 +08:00
parent 3fccbf0889
commit f0a6c2be8a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 21 additions and 19 deletions

File diff suppressed because one or more lines are too long

4
kernel/cache/ial.go vendored
View file

@ -19,7 +19,7 @@ package cache
import (
"strings"
"github.com/88250/lute/util"
"github.com/88250/lute/editor"
"github.com/dgraph-io/ristretto"
)
@ -41,7 +41,7 @@ func GetDocIAL(p string) (ret map[string]string) {
ret = map[string]string{}
for k, v := range ial.(map[string]string) {
ret[k] = strings.ReplaceAll(v, util.IALValEscNewLine, "\n")
ret[k] = strings.ReplaceAll(v, editor.IALValEscNewLine, "\n")
}
return
}

View file

@ -7,7 +7,7 @@ require (
github.com/88250/css v0.1.2
github.com/88250/flock v0.8.2
github.com/88250/gulu v1.2.3-0.20220909041418-fdfa4d7380bf
github.com/88250/lute v1.7.5-0.20220913011310-c9cfced8821e
github.com/88250/lute v1.7.5-0.20220913162658-41481d72c8f4
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1
github.com/88250/pdfcpu v0.3.13
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1

View file

@ -19,8 +19,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20220909041418-fdfa4d7380bf h1:q+iiBuKjdvUKj5dQQHCRs+g9oChTWkZmm7r1FMvtkfI=
github.com/88250/gulu v1.2.3-0.20220909041418-fdfa4d7380bf/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.5-0.20220913011310-c9cfced8821e h1:IHyxzo0cBmYb0pE6Alfs+WtbFkc5oKqI1e2OSUHhRmc=
github.com/88250/lute v1.7.5-0.20220913011310-c9cfced8821e/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20220913162658-41481d72c8f4 h1:U5jrcA+x5IZ4NnDSC94YN0xqNSCbFI9xV6FCGbjhi7M=
github.com/88250/lute v1.7.5-0.20220913162658-41481d72c8f4/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1 h1:9Cb+iN639vUI2OcIBc+4oGwml9/0J6bL6dWNb8Al+1s=
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1/go.mod h1:jH6MMPr8G7AMzaVmWHXZQiB1DKO3giWbcWZ7UoJ1teI=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=

View file

@ -32,6 +32,7 @@ import (
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/editor"
"github.com/88250/lute/html"
"github.com/88250/lute/lex"
"github.com/88250/lute/parse"
@ -1363,7 +1364,7 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros bool) (ret *parse.T
n.Unlink()
}
for _, emptyParagraph := range emptyParagraphs {
emptyParagraph.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(parse.Zwj)})
emptyParagraph.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(editor.Zwj)})
}
return ret
}

View file

@ -29,8 +29,8 @@ import (
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/editor"
"github.com/88250/lute/parse"
util2 "github.com/88250/lute/util"
"github.com/emirpasic/gods/sets/hashset"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
@ -423,7 +423,7 @@ func (tx *Transaction) doPrependInsert(operation *Operation) (ret *TxErr) {
return &TxErr{code: TxErrCodeBlockNotFound, id: block.ID}
}
data := strings.ReplaceAll(operation.Data.(string), util2.FrontEndCaret, "")
data := strings.ReplaceAll(operation.Data.(string), editor.FrontEndCaret, "")
luteEngine := NewLute()
subTree := luteEngine.BlockDOM2Tree(data)
insertedNode := subTree.Root.FirstChild
@ -511,7 +511,7 @@ func (tx *Transaction) doAppendInsert(operation *Operation) (ret *TxErr) {
return &TxErr{code: TxErrCodeBlockNotFound, id: block.ID}
}
data := strings.ReplaceAll(operation.Data.(string), util2.FrontEndCaret, "")
data := strings.ReplaceAll(operation.Data.(string), editor.FrontEndCaret, "")
luteEngine := NewLute()
subTree := luteEngine.BlockDOM2Tree(data)
insertedNode := subTree.Root.FirstChild
@ -720,7 +720,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
return &TxErr{code: TxErrCodeBlockNotFound, id: block.ID}
}
data := strings.ReplaceAll(operation.Data.(string), util2.FrontEndCaret, "")
data := strings.ReplaceAll(operation.Data.(string), editor.FrontEndCaret, "")
luteEngine := NewLute()
subTree := luteEngine.BlockDOM2Tree(data)
@ -853,7 +853,7 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) {
return &TxErr{code: TxErrCodeBlockNotFound, id: id}
}
data := strings.ReplaceAll(operation.Data.(string), util2.FrontEndCaret, "")
data := strings.ReplaceAll(operation.Data.(string), editor.FrontEndCaret, "")
if "" == data {
logging.LogErrorf("update data is nil")
return &TxErr{code: TxErrCodeBlockNotFound, id: id}