diff options
| author | 2024-09-16 14:00:23 +0200 | |
|---|---|---|
| committer | 2024-09-16 14:00:23 +0200 | |
| commit | efd1a4f717afa83d3d3609f0d70e4da151a8dc9b (patch) | |
| tree | 246ae4c12f86f8866e5299ae39ba5c1feba0bce4 /vendor/github.com/k3a/html2text/README.md | |
| parent | [bugfix/chore] Always set the status sensitive if media + content-warning pre... (diff) | |
| download | gotosocial-efd1a4f717afa83d3d3609f0d70e4da151a8dc9b.tar.xz | |
[bugfix] Use better plaintext representation of status for filtering (#3301)
* [bugfix] Use better plaintext representation of status for filtering
* add new deps to readme
* lint
* update tests
* update regexes
* address review comments
* remove now unused xxhash
* whoops, wrong logger
* Merge branch 'main' into status_filtering_bugfix
* put cache in caches struct
* pain
Diffstat (limited to 'vendor/github.com/k3a/html2text/README.md')
| -rw-r--r-- | vendor/github.com/k3a/html2text/README.md | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/vendor/github.com/k3a/html2text/README.md b/vendor/github.com/k3a/html2text/README.md new file mode 100644 index 000000000..892665905 --- /dev/null +++ b/vendor/github.com/k3a/html2text/README.md @@ -0,0 +1,60 @@ +[](https://godoc.org/github.com/k3a/html2text) +[](https://travis-ci.org/k3a/html2text) +[](https://coveralls.io/github/k3a/html2text?branch=master) +[](https://goreportcard.com/report/github.com/k3a/html2text) + +# html2text + +A simple Golang package to convert HTML to plain text (without non-standard dependencies). + +It converts HTML tags to text and also parses HTML entities into characters they represent. +A `<head>` section of the HTML document, as well as most other tags are stripped out but +links are properly converted into their href attribute. + +It can be used for converting HTML emails into text. + +Some tests are installed as well. +Uses semantic versioning and no breaking changes are planned. + +Fell free to publish a pull request if you have suggestions for improvement but please note that the library can now be considered feature-complete and API stable. If you need more than this basic conversion, please use an alternative mentioned at the bottom. + +## Install +```bash +go get github.com/k3a/html2text +``` + +## Usage + +```go +package main + +import ( + "fmt" + "github.com/k3a/html2text" +) + +func main() { + html := `<html><head><title>Good</title></head><body><strong>clean</strong> text</body>` + + plain := html2text.HTML2Text(html) + + fmt.Println(plain) +} + +/* Outputs: + + clean text +*/ + +``` + +To see all features, please look info `html2text_test.go`. + +## Alternatives +- https://github.com/jaytaylor/html2text (heavier, with more features) +- https://git.alexwennerberg.com/nanohtml2text (rewrite of this module in Rust) + +## License + +MIT + |
