Skip to content

Commit

Permalink
🐛 文档转换标题时层级计算溢出 siyuan-note/siyuan#2308
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jul 3, 2021
1 parent 25113f6 commit 6811d5b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions render/protyle_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,9 @@ func (r *BlockRenderer) renderBlockquoteMarker(node *ast.Node, entering bool) as
func (r *BlockRenderer) renderHeading(node *ast.Node, entering bool) ast.WalkStatus {
if entering {
var attrs [][]string
if 6 < node.HeadingLevel {
node.HeadingLevel = 6
}
level := headingLevel[node.HeadingLevel : node.HeadingLevel+1]
attrs = append(attrs, []string{"data-subtype", "h" + level})
r.blockNodeAttrs(node, &attrs, "h"+level)
Expand Down

0 comments on commit 6811d5b

Please sign in to comment.