mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
Replace 4 strings.Replace with 1 strings.Replacer
Consumes less memory, slightly faster.
This commit is contained in:
parent
5df85770fc
commit
2bee4a1570
2 changed files with 7 additions and 8 deletions
|
@ -14,6 +14,8 @@ func TestStripHTML(t *testing.T) {
|
|||
{"<h1>strip h1 tag <h1>", "strip h1 tag "},
|
||||
{"<p> strip p tag </p>", " strip p tag \n"},
|
||||
{"</br> strip br<br>", " strip br\n"},
|
||||
{"</br> strip br2<br />", " strip br2\n"},
|
||||
{"This <strong>is</strong> a\nnewline", "This is a newline"},
|
||||
}
|
||||
for i, d := range data {
|
||||
output := StripHTML(d.input)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue