New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helpers: Support complex HTML in plainify #9410
Conversation
Support complex HTML in plainify by replacing the simple HTML sripper with the sanitizer functionality of the bluemonday library, with a strict policy (to strip all HTML elements and their attributes) Fixes gohugoio#9199
Bluemonday is a HTML sanitizer. That is about removing unwanted/unsafe HTML -- this is about making it into plain text, which I would hope should be a simpler task not requiring that many new dependencies. I'm closing this for now, but thanks. |
Reopen, in case i don't find anything simpler. |
This commit replaces the main part of `helpers. ```bash BenchmarkStripHTMLOld-10 680316 1764 ns/op 728 B/op 4 allocs/op BenchmarkStripHTMLNew-10 384520 3099 ns/op 2089 B/op 10 allocs/op ``` Fixes gohugoio#9419 Fixes gohugoio#9909 Closes gohugoio#9410
This commit replaces the main part of `helpers.StripHTML` with Go's implementation in its html/template package. It's a little slower, but correctness is more important: ```bash BenchmarkStripHTMLOld-10 680316 1764 ns/op 728 B/op 4 allocs/op BenchmarkStripHTMLNew-10 384520 3099 ns/op 2089 B/op 10 allocs/op ``` Fixes gohugoio#9419 Fixes gohugoio#9909 Closes gohugoio#9410
This commit replaces the main part of `helpers.StripHTML` with Go's implementation in its html/template package. It's a little slower, but correctness is more important: ```bash BenchmarkStripHTMLOld-10 680316 1764 ns/op 728 B/op 4 allocs/op BenchmarkStripHTMLNew-10 384520 3099 ns/op 2089 B/op 10 allocs/op ``` Fixes gohugoio#9199 Fixes gohugoio#9909 Closes gohugoio#9410
This commit replaces the main part of `helpers.StripHTML` with Go's implementation in its html/template package. It's a little slower, but correctness is more important: ```bash BenchmarkStripHTMLOld-10 680316 1764 ns/op 728 B/op 4 allocs/op BenchmarkStripHTMLNew-10 384520 3099 ns/op 2089 B/op 10 allocs/op ``` Fixes gohugoio#9199 Fixes gohugoio#9909 Closes gohugoio#9410
This commit replaces the main part of `helpers.StripHTML` with Go's implementation in its html/template package. It's a little slower, but correctness is more important: ```bash BenchmarkStripHTMLOld-10 680316 1764 ns/op 728 B/op 4 allocs/op BenchmarkStripHTMLNew-10 384520 3099 ns/op 2089 B/op 10 allocs/op ``` Fixes #9199 Fixes #9909 Closes #9410
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Support complex HTML in plainify by replacing the simple HTML sripper with the sanitizer functionality of the bluemonday library, with a strict policy (to strip all HTML elements and their attributes)
Fixes #9199