فهرست منبع

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 2 سال پیش
والد
کامیت
bc850b331a
8فایلهای تغییر یافته به همراه4 افزوده شده و 36 حذف شده
  1. 0 6
      API.md
  2. 0 6
      API_zh_CN.md
  3. 0 12
      kernel/model/export.go
  4. 1 1
      kernel/model/graph.go
  5. 0 2
      kernel/model/render.go
  6. 0 2
      kernel/sql/block_query.go
  7. 3 5
      kernel/sql/database.go
  8. 0 2
      kernel/treenode/node.go

+ 0 - 6
API.md

@@ -999,9 +999,3 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
   ```
 
     * `data`: Precision in milliseconds
-
-## Webhook
-
-TBD
-
-https://ld246.com/article/1627956688432

+ 0 - 6
API_zh_CN.md

@@ -993,9 +993,3 @@
   ```
 
     * `data`: 精度为毫秒
-
-## Webhook
-
-TBD
-
-https://ld246.com/article/1627956688432

+ 0 - 12
kernel/model/export.go

@@ -1073,18 +1073,6 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool) (re
 		}
 
 		switch n.Type {
-		case ast.NodeTagOpenMarker: // 配置标签开始标记符
-			if !wysiwyg {
-				n.Type = ast.NodeText
-				n.Tokens = []byte(Conf.Export.TagOpenMarker)
-				return ast.WalkContinue
-			}
-		case ast.NodeTagCloseMarker: // 配置标记结束标记符
-			if !wysiwyg {
-				n.Type = ast.NodeText
-				n.Tokens = []byte(Conf.Export.TagCloseMarker)
-				return ast.WalkContinue
-			}
 		case ast.NodeSuperBlockOpenMarker, ast.NodeSuperBlockLayoutMarker, ast.NodeSuperBlockCloseMarker:
 			if !wysiwyg {
 				unlinks = append(unlinks, n)

+ 1 - 1
kernel/model/graph.go

@@ -700,7 +700,7 @@ func query2Stmt(queryStr string) (ret string) {
 			if !entering {
 				return ast.WalkContinue
 			}
-			if ast.NodeTag == n.Type || (n.IsTextMarkType("tag")) {
+			if n.IsTextMarkType("tag") {
 				tags = append(tags, n.Text())
 			}
 			return ast.WalkContinue

+ 0 - 2
kernel/model/render.go

@@ -46,8 +46,6 @@ func renderOutline(node *ast.Node, luteEngine *lute.Lute) (ret string) {
 			return ast.WalkContinue
 		}
 		switch n.Type {
-		case ast.NodeTagOpenMarker, ast.NodeTagCloseMarker:
-			buf.WriteByte('#')
 		case ast.NodeBlockRef:
 			buf.WriteString(html.EscapeString(treenode.GetDynamicBlockRefText(n)))
 			return ast.WalkSkipChildren

+ 0 - 2
kernel/sql/block_query.go

@@ -656,8 +656,6 @@ func GetContainerText(container *ast.Node) string {
 			return ast.WalkContinue
 		}
 		switch n.Type {
-		case ast.NodeTagOpenMarker, ast.NodeTagCloseMarker:
-			buf.WriteByte('#')
 		case ast.NodeText, ast.NodeLinkText, ast.NodeFileAnnotationRefText, ast.NodeFootnotesRef,
 			ast.NodeCodeSpanContent, ast.NodeInlineMathContent, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
 			buf.Write(n.Tokens)

+ 3 - 5
kernel/sql/database.go

@@ -428,8 +428,6 @@ func resolveRefContent0(node *ast.Node, anchors *map[string]string, depth *int,
 		case ast.NodeDocument:
 			buf.WriteString(n.IALAttr("title"))
 			return ast.WalkStop
-		case ast.NodeTagOpenMarker, ast.NodeTagCloseMarker:
-			buf.WriteByte('#')
 		case ast.NodeText, ast.NodeLinkText, ast.NodeLinkTitle, ast.NodeFileAnnotationRefText, ast.NodeFootnotesRef,
 			ast.NodeCodeSpanContent, ast.NodeInlineMathContent, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
 			buf.Write(n.Tokens)
@@ -620,11 +618,11 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
 		}
 		assets = append(assets, asset)
 		return
-	case ast.NodeTag, ast.NodeInlineMath, ast.NodeCodeSpan, ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline, ast.NodeTextMark:
+	case ast.NodeInlineMath, ast.NodeCodeSpan, ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline, ast.NodeTextMark:
 		typ := treenode.TypeAbbr(n.Type.String())
 		var text string
 		switch n.Type {
-		case ast.NodeTag, ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline:
+		case ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline:
 			text = n.Text()
 		case ast.NodeInlineMath:
 			text = n.ChildByType(ast.NodeInlineMathContent).TokensStr()
@@ -843,7 +841,7 @@ func tagFromNode(node *ast.Node) (ret string) {
 			return ast.WalkContinue
 		}
 
-		if ast.NodeTag == n.Type || n.IsTextMarkType("tag") {
+		if n.IsTextMarkType("tag") {
 			tagBuilder.WriteString("#")
 			tagBuilder.WriteString(n.Text())
 			tagBuilder.WriteString("# ")

+ 0 - 2
kernel/treenode/node.go

@@ -126,8 +126,6 @@ func NodeStaticContent(node *ast.Node) string {
 		}
 
 		switch n.Type {
-		case ast.NodeTagOpenMarker, ast.NodeTagCloseMarker:
-			buf.WriteByte('#')
 		case ast.NodeBlockRef:
 			buf.WriteString(GetDynamicBlockRefText(n))
 			lastSpace = false