示例#1
0
func textProcessedBySmartypants(text string) string {
	buffer := new(bytes.Buffer)
	smartypants.New(buffer, 0).Write([]byte(text))
	ret := buffer.String()

	// At this point `ret` contains HTML special entities like <
	// so we gotta get rid of them.

	return html.UnescapeString(ret)
}
示例#2
0
文件: main.go 项目: kr/blog
func educate(b []byte) []byte {
	buf := new(bytes.Buffer)
	smartypants.New(buf, 0).Write(b)
	return buf.Bytes()
}