Skip to content

Commit

Permalink
🎨 Vditor 支持 Vanessa219/vditor#103
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Feb 5, 2020
1 parent 812ac6f commit 4336378
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
13 changes: 13 additions & 0 deletions h2m.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,19 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *Tree) {
defer tree.context.parentTip(n)
case atom.Th, atom.Td:
node.typ = NodeTableCell
align := lute.domAttrValue(n, "align")
var tableAlign int
switch align {
case "left":
tableAlign = 1
case "center":
tableAlign = 2
case "right":
tableAlign = 3
default:
tableAlign = 0
}
node.tableCellAlign = tableAlign
tree.context.tip.AppendChild(node)
tree.context.tip = node
defer tree.context.parentTip(n)
Expand Down
Loading

0 comments on commit 4336378

Please sign in to comment.