消字后撇号改变


package main
import (
"log"
"github.com/microcosm-cc/bluemonday"
)
func main() {
c := "hello doesn't work 😖"
p := bluemonday.UGCPolicy()

log.Println(p.Sanitize(c))
}

期望的输出应该是hello doesn't work 😖相反,我收到hello doesn't work 😖

我尝试使用allowlist与regexp,但它不工作

这在HTML上下文中并没有真正的变化,如下所示:

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

最新更新