@@ -156,11 +156,14 @@ func (r *Renderer) ListItem(out *bytes.Buffer, text []byte, flags int) {
156
156
switch {
157
157
case bytes .HasPrefix (text , []byte (prefix + "[ ] " )):
158
158
text = append ([]byte (`<div class="ui fitted disabled checkbox"><input type="checkbox" disabled="disabled" /><label /></div>` ), text [3 + len (prefix ):]... )
159
+ if prefix != "" {
160
+ text = bytes .Replace (text , []byte (prefix ), []byte {}, 1 )
161
+ }
159
162
case bytes .HasPrefix (text , []byte (prefix + "[x] " )):
160
163
text = append ([]byte (`<div class="ui checked fitted disabled checkbox"><input type="checkbox" checked="" disabled="disabled" /><label /></div>` ), text [3 + len (prefix ):]... )
161
- }
162
- if prefix != "" {
163
- text = bytes . Replace ( text , [] byte ( "</p>" ), [] byte {}, 1 )
164
+ if prefix != "" {
165
+ text = bytes . Replace ( text , [] byte ( prefix ), [] byte {}, 1 )
166
+ }
164
167
}
165
168
r .Renderer .ListItem (out , text , flags )
166
169
}
@@ -638,10 +641,8 @@ OUTER_LOOP:
638
641
// Copy the token to the output verbatim
639
642
buf .Write (RenderShortLinks ([]byte (token .String ()), urlPrefix , true , isWikiMarkdown ))
640
643
641
- if token .Type == html .StartTagToken {
642
- if ! com .IsSliceContainsStr (noEndTags , token .Data ) {
643
- stackNum ++
644
- }
644
+ if token .Type == html .StartTagToken && ! com .IsSliceContainsStr (noEndTags , token .Data ) {
645
+ stackNum ++
645
646
}
646
647
647
648
// If this is the close tag to the outer-most, we are done
@@ -656,8 +657,8 @@ OUTER_LOOP:
656
657
continue OUTER_LOOP
657
658
}
658
659
659
- if ! com .IsSliceContainsStr (noEndTags , token . Data ) {
660
- startTags = append (startTags , token . Data )
660
+ if ! com .IsSliceContainsStr (noEndTags , tagName ) {
661
+ startTags = append (startTags , tagName )
661
662
}
662
663
663
664
case html .EndTagToken :
0 commit comments