Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
🐞 fix(信息样式渲染): 修复内联样式失效问题
Browse files Browse the repository at this point in the history
  • Loading branch information
2234839 committed May 21, 2021
1 parent 004136e commit fdee0eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/store/toHTML.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,11 @@ func (r *OceanpressRenderer) NodeSuperBlock(node *ast.Node, entering bool) ast.W
html += r.renderNodeToHTML(n, true)
}
// TODO: 采用模板
html = "<div data-type=\"NodeSuperBlock\" data-sb-layout=\"" + layout + "\" >" + html + "</div>"
r.context.rawRenderer.Newline()
node.KramdownIAL = append(node.KramdownIAL, []string{"data-sb-layout", layout})
r.context.rawRenderer.Tag("div", node.KramdownIAL, false)
r.WriteHTML(html)
r.context.rawRenderer.Tag("/div", nil, false)
return ast.WalkSkipChildren
}

Expand Down Expand Up @@ -305,6 +308,7 @@ func (r *OceanpressRenderer) 模板复制粘贴用(node *ast.Node, entering bool
})(node, entering)
}

// 文档根节点
func (r *OceanpressRenderer) NodeDocumentRender(node *ast.Node, entering bool) ast.WalkStatus {
if entering {
r.context.rawRenderer.Tag("main", node.KramdownIAL, false)
Expand Down

0 comments on commit fdee0eb

Please sign in to comment.