@@ -102,6 +102,7 @@ func TestHTML2Text(t *testing.T) {
102102 So (HTML2Text (`` ), ShouldEqual , "" )
103103 So (HTML2Text (`<html><head><title>Good</title></head><body>x</body>` ), ShouldEqual , "x" )
104104 So (HTML2Text (`<html><head href="foo"><title>Good</title></head><body>x</body>` ), ShouldEqual , "x" )
105+ So (HTML2Text (`<htMl><hEad><titLe>Good</Title></head><boDy>x</Body>` ), ShouldEqual , "x" )
105106 So (HTML2Text (`we are not <script type="javascript"></script>interested in scripts` ),
106107 ShouldEqual , "we are not interested in scripts" )
107108 })
@@ -122,6 +123,15 @@ func TestHTML2Text(t *testing.T) {
122123 So (HTML2TextWithOptions (`<p>two</p><p>paragraphs</p>` ), ShouldEqual , "two\r \n \r \n paragraphs" )
123124 })
124125
126+ Convey ("No list support by default (original behavior)" , func () {
127+ So (HTML2Text (`list of items<ul><li>One</li><li>Two</li><li>Three</li></ul>` ), ShouldEqual , "list of items\r \n One\r \n Two\r \n Three\r \n " )
128+ })
129+
130+ Convey ("Optional list support" , func () {
131+ So (HTML2TextWithOptions (`list of items<ul><li>One</li><li>Two</li><li>Three</li></ul>` , WithListSupport ()), ShouldEqual , "list of items\r \n - One\r \n - Two\r \n - Three\r \n " )
132+ So (HTML2TextWithOptions (`list of items<ol><li>One</li><li>Two</li><li>Three</li></ol>` , WithListSupport ()), ShouldEqual , "list of items\r \n - One\r \n - Two\r \n - Three\r \n " )
133+ })
134+
125135 Convey ("Custom HTML Tags" , func () {
126136 So (HTML2Text (`<aa>hello</aa>` ), ShouldEqual , "hello" )
127137 So (HTML2Text (`<aa >hello</aa>` ), ShouldEqual , "hello" )
0 commit comments