Compare commits
2 commits
2f38a07cb5
...
fd9985892c
Author | SHA1 | Date | |
---|---|---|---|
fd9985892c | |||
8e2a642bc0 |
1 changed files with 7 additions and 1 deletions
|
@ -43,7 +43,13 @@ func StripHTMLTags(text string) string {
|
||||||
case html.ErrorToken:
|
case html.ErrorToken:
|
||||||
return builder.String()
|
return builder.String()
|
||||||
case html.TextToken:
|
case html.TextToken:
|
||||||
builder.WriteString(token.Token().Data + " ")
|
text := token.Token().String()
|
||||||
|
builder.WriteString(text)
|
||||||
|
case html.StartTagToken:
|
||||||
|
tag := token.Token().String()
|
||||||
|
if tag == "<br>" {
|
||||||
|
builder.WriteString("\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue