-
Notifications
You must be signed in to change notification settings - Fork 23
/
html2markdown_test.go
48 lines (37 loc) · 1.38 KB
/
html2markdown_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package html2md
import (
"io/ioutil"
"testing"
)
func TestConvert(t *testing.T) {
b, _ := ioutil.ReadFile("example/code.html")
md := Convert(string(b))
ioutil.WriteFile("example/code.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/resuite.html")
md = Convert(string(b))
ioutil.WriteFile("example/resuite.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/hello.html")
md = Convert(string(b))
ioutil.WriteFile("example/hello.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/gitbook.html")
md = Convert(string(b))
ioutil.WriteFile("example/gitbook.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/github.io.html")
md = Convert(string(b))
ioutil.WriteFile("example/github.io.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/readthedoc.html")
md = Convert(string(b))
ioutil.WriteFile("example/readthedoc.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/gitee.html")
md = Convert(string(b))
ioutil.WriteFile("example/gitee.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/gitbook1.html")
md = Convert(string(b))
ioutil.WriteFile("example/gitbook1.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/django.html")
md = Convert(string(b))
ioutil.WriteFile("example/django.md", []byte(md), 0777)
b, _ = ioutil.ReadFile("example/blockquote.html")
md = Convert(string(b))
ioutil.WriteFile("example/blockquote.md", []byte(md), 0777)
}