Codebase list golang-github-jaytaylor-html2text / d51a372
Added sample output to readme. Jay Taylor 9 years ago
1 changed file(s) with 35 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2222 package main
2323
2424 import (
25 "log"
25 "fmt"
2626
2727 "github.com/jaytaylor/html2text"
2828 )
4646 if err != nil {
4747 panic(err)
4848 }
49 log.Printf("input: %s\n\noutput: %s\n", inputHtml, text)
49 fmt.Printf("input:\n\n%s\n\noutput:\n\n%s\n", inputHtml, text)
5050 }
51 ```
52
53 Output:
54 ```
55 input:
56
57 <div class="hard-to-read">
58 Welcome to your new account on my service!
59 </div>
60
61 <p>
62 Here is some more information:
63
64 <ul>
65 <li>Link 1: <a href="https://example.com">Example.com</a></li>
66 <li>Link 2: <a href="https://example.com">Example.com</a></li>
67 <li>Something else</li>
68 </ul>
69 </p>
70
71 output:
72
73 Welcome to your new account on my service!
74
75 Here is some more information:
76
77 Link 1:
78 https://example.com
79
80 Link 2:
81 https://example.com
82
83 Something else
5184 ```
5285
5386