Skip to content

Commit

Permalink
莫名其妙,啥时候把 continue 删除了?
Browse files Browse the repository at this point in the history
  • Loading branch information
movsb committed Apr 8, 2024
1 parent 659601c commit cdc9e20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/modules/renderers/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (me *_Markdown) Render(source string) (string, string, error) {
var title string
maxDepth := 10000 // this is to avoid unwanted infinite loop.
n := 0
// TODO 移除这个循环,换 AstWalk
for p := doc.FirstChild(); p != nil && n < maxDepth; n++ {
switch {
case p.Kind() == ast.KindHeading:
Expand All @@ -135,7 +136,7 @@ func (me *_Markdown) Render(source string) (string, string, error) {
parent := heading.Parent()
parent.RemoveChild(parent, heading)
// p 已经 next,否则循环结束的时候再 next 会出错
// continue
continue
}
}
}
Expand Down

0 comments on commit cdc9e20

Please sign in to comment.