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