@@ -15,6 +15,13 @@ func TestHTML2Text(t *testing.T) {
1515
1616 // the original behavior
1717 So (HTML2Text (`click <a href="test">here</a>` ), ShouldEqual , "click test" )
18+ So (HTML2Text (`click <A hRef="test">here</A>` ), ShouldEqual , "click test" )
19+ So (HTML2Text (`click <a href='test'>here</a>` ), ShouldEqual , "click test" )
20+ So (HTML2Text (`click <a href=test>here</a>` ), ShouldEqual , "click test" )
21+ So (HTML2Text (`click <a href =test>here</a>` ), ShouldEqual , "click test" )
22+ So (HTML2Text (`click <a href = test>here</a>` ), ShouldEqual , "click test" )
23+ So (HTML2Text (`click <a href = test>here</a>` ), ShouldEqual , "click test" )
24+ So (HTML2Text (`click <a href = test target="_blank">here</a>` ), ShouldEqual , "click test" )
1825 So (HTML2Text (`click <a class="x" href="test">here</a>` ), ShouldEqual , "click test" )
1926 So (HTML2Text (`click <a href="ents/'x'">here</a>` ), ShouldEqual , "click ents/'x'" )
2027 So (HTML2Text (`click <a href="javascript:void(0)">here</a>` ), ShouldEqual , "click " )
@@ -24,6 +31,13 @@ func TestHTML2Text(t *testing.T) {
2431
2532 // with inner text
2633 So (HTML2TextWithOptions (`click <a href="test">here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
34+ So (HTML2TextWithOptions (`click <A hRef="test">here</A>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
35+ So (HTML2TextWithOptions (`click <a href='test'>here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
36+ So (HTML2TextWithOptions (`click <a href=test>here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
37+ So (HTML2TextWithOptions (`click <a href =test>here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
38+ So (HTML2TextWithOptions (`click <a href = test>here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
39+ So (HTML2TextWithOptions (`click <a href = test>here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
40+ So (HTML2TextWithOptions (`click <a href = test target="_blank">here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
2741 So (HTML2TextWithOptions (`click <a class="x" href="test">here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <test>" )
2842 So (HTML2TextWithOptions (`click <a href="ents/'x'">here</a>` , WithLinksInnerText ()), ShouldEqual , "click here <ents/'x'>" )
2943 So (HTML2TextWithOptions (`click <a href="javascript:void(0)">here</a>` , WithLinksInnerText ()), ShouldEqual , "click here" )
@@ -87,6 +101,7 @@ func TestHTML2Text(t *testing.T) {
87101 Convey ("Full HTML structure" , func () {
88102 So (HTML2Text (`` ), ShouldEqual , "" )
89103 So (HTML2Text (`<html><head><title>Good</title></head><body>x</body>` ), ShouldEqual , "x" )
104+ So (HTML2Text (`<html><head href="foo"><title>Good</title></head><body>x</body>` ), ShouldEqual , "x" )
90105 So (HTML2Text (`we are not <script type="javascript"></script>interested in scripts` ),
91106 ShouldEqual , "we are not interested in scripts" )
92107 })
0 commit comments