update
This commit is contained in:
@@ -11,19 +11,25 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
p = e.PanicErr
|
||||
reEOL = regexp.MustCompile(`[.!?]['"”’]?$`)
|
||||
reNEOL = regexp.MustCompile(`[.!?]['"”’]?\p{Lu}\p{Ll}+\.?`)
|
||||
reLET = regexp.MustCompile(`\p{Lu}`)
|
||||
reBody = regexp.MustCompile(`<[bB][rR][ /]*>`)
|
||||
p = e.PanicErr
|
||||
reEOL = regexp.MustCompile(`[.!?]['"”’]?$`)
|
||||
reNEOL = regexp.MustCompile(`[.!?]['"”’]?\p{Lu}\p{Ll}+\.?`)
|
||||
reLET = regexp.MustCompile(`\p{Lu}`)
|
||||
reBody = regexp.MustCompile(`<[bB][rR][ /]*>`)
|
||||
reQuotLeft = regexp.MustCompile(`<em>|<i>`)
|
||||
reQuotRight = regexp.MustCompile(`</em>|</i>`)
|
||||
)
|
||||
|
||||
func HtmlFix(body []byte) []byte {
|
||||
return reBody.ReplaceAllLiteral(body, []byte(" "))
|
||||
func HtmlFix(html []byte) []byte {
|
||||
html = reQuotLeft.ReplaceAllLiteral(html, []byte(" „"))
|
||||
html = reQuotRight.ReplaceAllLiteral(html, []byte("” "))
|
||||
return reBody.ReplaceAllLiteral(html, []byte(" "))
|
||||
}
|
||||
|
||||
func HtmlFixString(body string) string {
|
||||
return reBody.ReplaceAllLiteralString(body, " ")
|
||||
func HtmlFixString(html string) string {
|
||||
html = reQuotLeft.ReplaceAllLiteralString(html, " „")
|
||||
html = reQuotRight.ReplaceAllLiteralString(html, "” ")
|
||||
return reBody.ReplaceAllLiteralString(html, " ")
|
||||
}
|
||||
|
||||
func AddEnd(s string) string {
|
||||
|
||||
Reference in New Issue
Block a user