File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const (
1313)
1414
1515var lbr = WIN_LBR
16- var badTagnamesRE = regexp .MustCompile (`^(head|script|style|a)($|\s* )` )
16+ var badTagnamesRE = regexp .MustCompile (`^(head|script|style|a)($|\s+ )` )
1717var linkTagRE = regexp .MustCompile (`a.*href=('([^']*?)'|"([^"]*?)")` )
1818var badLinkHrefRE = regexp .MustCompile (`javascript:` )
1919var headersRE = regexp .MustCompile (`^(\/)?h[1-6]` )
Original file line number Diff line number Diff line change @@ -87,5 +87,11 @@ func TestHTML2Text(t *testing.T) {
8787 So (HTML2Text (`<p>two</p><p>paragraphs</p>` ), ShouldEqual , "two\r \n \r \n paragraphs" )
8888 })
8989
90+ Convey ("Custom HTML Tags" , func () {
91+ So (HTML2Text (`<aa>hello</aa>` ), ShouldEqual , "hello" )
92+ So (HTML2Text (`<aa >hello</aa>` ), ShouldEqual , "hello" )
93+ So (HTML2Text (`<aa x="1">hello</aa>` ), ShouldEqual , "hello" )
94+ })
95+
9096 })
9197}
You can’t perform that action at this time.
0 commit comments