Skip to content

Commit

Permalink
Revert "refactor: try BlockNodeConverter"
Browse files Browse the repository at this point in the history
This reverts commit ab4b5a7.
  • Loading branch information
KyleKing committed Jan 2, 2025
1 parent ab4b5a7 commit 05a9f2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions djot_parser/djot_html.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ var DefaultConversionRegistry = map[DjotNode]Conversion{
ListItemNode: func(s ConversionState, n func(c Children)) {
class := s.Node.Attributes.Get(djot_tokenizer.DjotAttributeClassKey)
if class == CheckedTaskItemClass || class == UncheckedTaskItemClass {
s.Node.Attributes.Set(djot_tokenizer.DjotAttributeClassKey, "")
s.BlockNodeConverter("li", (func(c Children) {
s.Writer.InTag("li")(func() {
s.Writer.WriteString("\n")
s.Writer.WriteString("<input disabled=\"\" type=\"checkbox\"")
if class == CheckedTaskItemClass {
s.Writer.WriteString(" checked=\"\"")
}
s.Writer.WriteString("/>").WriteString("\n")
n(s.Node.Children[:1])
s.Writer.WriteString("\n")
}))
}).WriteString("\n")
} else {
s.BlockNodeConverter("li", n)
}
Expand Down

0 comments on commit 05a9f2f

Please sign in to comment.