@@ -12,6 +12,17 @@ const (
1212
1313 boldText = "<strong>Bold Text</strong>"
1414 boldEscape = "<strong>option src_ip</strong>"
15+
16+ excludingControlTest = `<div class="outter-class">
17+ <h1 class="inner-class">
18+ <div class="other-class3">
19+ <h3>Some heading i don't need</h3>
20+ </div>
21+ The string I need
22+ <span class="other-class" >Some value I don't need</span>
23+ <span class="other-class2" title="sometitle"></span>
24+ </h1>
25+ </div>`
1526)
1627
1728type testCase struct {
@@ -45,6 +56,20 @@ func TestExec(t *testing.T) {
4556 "Only <del>blue ones</del> <s> left</s>" ,
4657 []string {"-i" , "--plugin-strikethrough" },
4758 },
59+ {
60+ "ExclChildren" , "The string I need" , excludingControlTest ,
61+ []string {"-s" , "h1" , "--xc" , "-i" },
62+ },
63+ {
64+ "Excl1" , `### Some heading i don't need
65+
66+ The string I need` , excludingControlTest ,
67+ []string {"-s" , "h1" , "-xspan" , "-i" },
68+ },
69+ {
70+ "Excl2" , "The string I need" , excludingControlTest ,
71+ []string {"-s" , "h1" , "-x" , "span" , "-xdiv" , "-i" },
72+ },
4873 // {
4974 // "", "", "", []string{"-i"},
5075 // },
0 commit comments