简体   繁体   中英

Apostrophe changes after sanitizing word

package main

import (
"log"
"github.com/microcosm-cc/bluemonday"
)

func main() {
c := "hello doesn't work 😖"

    p := bluemonday.UGCPolicy()
    
    log.Println(p.Sanitize(c))

}

the expected output should be hello doesn't work instead i receive hello doesn't work

I try by using allowlist with regexp but it doesn't work

That's not really a change in the context of HTML, as you can see below:

 <div>hello doesn't work </div> <div>hello doesn&#39;t work </div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM