소스 검색

:art: 行级元素支持嵌套和交叉 https://github.com/siyuan-note/siyuan/issues/2911

Liang Ding 2 년 전
부모
커밋
f0a6c2be8a
6개의 변경된 파일12개의 추가작업 그리고 11개의 파일을 삭제
  1. 0 0
      app/stage/protyle/js/lute/lute.min.js
  2. 2 2
      kernel/cache/ial.go
  3. 1 1
      kernel/go.mod
  4. 2 2
      kernel/go.sum
  5. 2 1
      kernel/model/export.go
  6. 5 5
      kernel/model/transaction.go

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
app/stage/protyle/js/lute/lute.min.js


+ 2 - 2
kernel/cache/ial.go

@@ -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
 }

+ 1 - 1
kernel/go.mod

@@ -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

+ 2 - 2
kernel/go.sum

@@ -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=

+ 2 - 1
kernel/model/export.go

@@ -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
 }

+ 5 - 5
kernel/model/transaction.go

@@ -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}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.