diff --git a/html2text.go b/html2text.go index f1d2703..682d29a 100644 --- a/html2text.go +++ b/html2text.go @@ -31,7 +31,7 @@ type options struct { func newOptions() *options { // apply defaults return &options{ - lbr: WIN_LBR, + lbr: WIN_LBR, keepSpaces: false, } } @@ -261,7 +261,7 @@ func HTML2TextWithOptions(html string, reqOpts ...Option) string { if tagNameLowercase == "/ul" || tagNameLowercase == "/ol" { outBuf.WriteString(opts.lbr) - } else if tagNameLowercase == "li" || tagNameLowercase == "li/" { + } else if tagNameLowercase == "li" || tagNameLowercase == "li/" || strings.HasPrefix(tagNameLowercase, "li ") { if opts.listPrefix != "" { outBuf.WriteString(opts.lbr + opts.listPrefix) } else { diff --git a/html2text_test.go b/html2text_test.go index 33fa63b..d28afda 100644 --- a/html2text_test.go +++ b/html2text_test.go @@ -127,6 +127,11 @@ func TestHTML2Text(t *testing.T) { So(HTML2Text(`list of items