Skip to content

Commit

Permalink
refactor: replace strings with const
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing committed Jan 2, 2025
1 parent d0f81f0 commit ea3f76f
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 @@ -92,12 +92,12 @@ var DefaultConversionRegistry = map[DjotNode]Conversion{
UnorderedListNode: func(s ConversionState, n func(c Children)) { s.BlockNodeConverter("ul", n) },
OrderedListNode: func(s ConversionState, n func(c Children)) { s.BlockNodeConverter("ol", n) },
ListItemNode: func(s ConversionState, n func(c Children)) {
class := s.Node.Attributes.Get("class")
if class == "checked" || class == "unchecked" {
class := s.Node.Attributes.Get(djot_tokenizer.DjotAttributeClassKey)
if class == CheckedTaskItemClass || class == UncheckedTaskItemClass {
s.Writer.InTag("li")(func() {
s.Writer.WriteString("\n")
s.Writer.WriteString("<input disabled=\"\" type=\"checkbox\"")
if class == "checked" {
if class == CheckedTaskItemClass {
s.Writer.WriteString(" checked=\"\"")
}
s.Writer.WriteString("/>").WriteString("\n")
Expand Down

0 comments on commit ea3f76f

Please sign in to comment.