Esempio n. 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)
}
Esempio n. 2
0
File: main.go Progetto: kr/blog
func educate(b []byte) []byte {
	buf := new(bytes.Buffer)
	smartypants.New(buf, 0).Write(b)
	return buf.Bytes()
}