@@ -35,6 +35,7 @@ import (
35
35
"github.com/88250/gulu"
36
36
"github.com/88250/lute"
37
37
"github.com/88250/lute/ast"
38
+ "github.com/88250/lute/editor"
38
39
"github.com/88250/lute/html"
39
40
"github.com/88250/lute/lex"
40
41
"github.com/88250/lute/parse"
@@ -572,6 +573,7 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
572
573
replacement = strings .TrimPrefix (replacement , "#" )
573
574
replacement = strings .TrimSuffix (replacement , "#" )
574
575
tags = strings .ReplaceAll (tags , keyword , replacement )
576
+ tags = strings .ReplaceAll (tags , editor .Zwsp , "" )
575
577
node .SetIALAttr ("tags" , tags )
576
578
ReloadTag ()
577
579
}
@@ -586,6 +588,7 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
586
588
replacement = strings .TrimPrefix (replacement , "#" )
587
589
replacement = strings .TrimSuffix (replacement , "#" )
588
590
tags = r .ReplaceAllString (tags , replacement )
591
+ tags = strings .ReplaceAll (tags , editor .Zwsp , "" )
589
592
node .SetIALAttr ("tags" , tags )
590
593
ReloadTag ()
591
594
}
@@ -971,6 +974,7 @@ func replaceNodeTextMarkTextContent(n *ast.Node, method int, keyword, escapedKey
971
974
} else if strings .Contains (content , keyword ) {
972
975
content = strings .ReplaceAll (content , keyword , replacement )
973
976
}
977
+ content = strings .ReplaceAll (content , editor .Zwsp , "" )
974
978
975
979
tree := parse .Inline ("" , []byte (content ), luteEngine .ParseOptions )
976
980
if nil == tree .Root .FirstChild {
@@ -1009,10 +1013,12 @@ func replaceNodeTextMarkTextContent(n *ast.Node, method int, keyword, escapedKey
1009
1013
} else if strings .Contains (n .TextMarkTextContent , keyword ) {
1010
1014
n .TextMarkTextContent = strings .ReplaceAll (n .TextMarkTextContent , keyword , replacement )
1011
1015
}
1016
+ n .TextMarkTextContent = strings .ReplaceAll (n .TextMarkTextContent , editor .Zwsp , "" )
1012
1017
} else if 3 == method {
1013
1018
if nil != r && r .MatchString (n .TextMarkTextContent ) {
1014
1019
n .TextMarkTextContent = r .ReplaceAllString (n .TextMarkTextContent , replacement )
1015
1020
}
1021
+ n .TextMarkTextContent = strings .ReplaceAll (n .TextMarkTextContent , editor .Zwsp , "" )
1016
1022
}
1017
1023
}
1018
1024
0 commit comments