aboutsummaryrefslogtreecommitdiff
path: root/html2md_test.go
diff options
context:
space:
mode:
authorTong Sun <[email protected]>2023-05-03 12:35:08 -0400
committerTong Sun <[email protected]>2023-05-03 12:35:08 -0400
commit098407f5d50b96b8bbb94bc9c03a8ba7bde073ad (patch)
treed1e59d7acdde0f110982f6a5b3e50e5b30723e13 /html2md_test.go
parent- [+] add excluding control wireframe (diff)
downloadhtml2md-098407f5d50b96b8bbb94bc9c03a8ba7bde073ad.tar.xz
html2md-098407f5d50b96b8bbb94bc9c03a8ba7bde073ad.zip
- [+] implement excluding control. close #6
Diffstat (limited to 'html2md_test.go')
-rw-r--r--html2md_test.go25
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"},
// },