diff options
Diffstat (limited to 'html2md_test.go')
| -rw-r--r-- | html2md_test.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/html2md_test.go b/html2md_test.go index c8e6507..cba8f44 100644 --- a/html2md_test.go +++ b/html2md_test.go @@ -12,6 +12,17 @@ const ( boldText = "<strong>Bold Text</strong>" boldEscape = "<strong>option src_ip</strong>" + + excludingControlTest = `<div class="outter-class"> + <h1 class="inner-class"> + <div class="other-class3"> + <h3>Some heading i don't need</h3> + </div> + The string I need + <span class="other-class" >Some value I don't need</span> + <span class="other-class2" title="sometitle"></span> + </h1> + </div>` ) type testCase struct { @@ -45,6 +56,20 @@ func TestExec(t *testing.T) { "Only <del>blue ones</del> <s> left</s>", []string{"-i", "--plugin-strikethrough"}, }, + { + "ExclChildren", "The string I need", excludingControlTest, + []string{"-s", "h1", "--xc", "-i"}, + }, + { + "Excl1", `### Some heading i don't need + + The string I need`, excludingControlTest, + []string{"-s", "h1", "-xspan", "-i"}, + }, + { + "Excl2", "The string I need", excludingControlTest, + []string{"-s", "h1", "-x", "span", "-xdiv", "-i"}, + }, // { // "", "", "", []string{"-i"}, // }, |