Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
5cdc156360
2 changed files with 0 additions and 13 deletions
|
@ -22,7 +22,6 @@ import (
|
|||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
|
@ -118,16 +117,12 @@ func (tx *Transaction) doUnfoldHeading(operation *Operation) (ret *TxErr) {
|
|||
return
|
||||
}
|
||||
|
||||
var docConvertLock = sync.Mutex{}
|
||||
|
||||
func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath string, err error) {
|
||||
if !ast.IsNodeIDPattern(srcID) || !ast.IsNodeIDPattern(targetID) {
|
||||
return
|
||||
}
|
||||
|
||||
FlushTxQueue()
|
||||
docConvertLock.Lock()
|
||||
defer docConvertLock.Unlock()
|
||||
|
||||
srcTree, _ := LoadTreeByBlockID(srcID)
|
||||
if nil == srcTree {
|
||||
|
@ -253,10 +248,6 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
|
|||
pivot.InsertAfter(heading)
|
||||
}
|
||||
|
||||
if contentPivot := treenode.GetNodeInTree(targetTree, targetID); nil != contentPivot && ast.NodeParagraph == contentPivot.Type && nil == contentPivot.FirstChild { // 插入到空的段落块下
|
||||
contentPivot.Unlink()
|
||||
}
|
||||
|
||||
box := Conf.Box(srcTree.Box)
|
||||
if removeErr := box.Remove(srcTree.Path); nil != removeErr {
|
||||
logging.LogWarnf("remove tree [%s] failed: %s", srcTree.Path, removeErr)
|
||||
|
@ -282,8 +273,6 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
|
|||
|
||||
func Heading2Doc(srcHeadingID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error) {
|
||||
FlushTxQueue()
|
||||
docConvertLock.Lock()
|
||||
defer docConvertLock.Unlock()
|
||||
|
||||
srcTree, _ := LoadTreeByBlockID(srcHeadingID)
|
||||
if nil == srcTree {
|
||||
|
|
|
@ -29,8 +29,6 @@ import (
|
|||
|
||||
func ListItem2Doc(srcListItemID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error) {
|
||||
FlushTxQueue()
|
||||
docConvertLock.Lock()
|
||||
defer docConvertLock.Unlock()
|
||||
|
||||
srcTree, _ := LoadTreeByBlockID(srcListItemID)
|
||||
if nil == srcTree {
|
||||
|
|
Loading…
Add table
Reference in a new issue