all repos — grayfriday @ 31a96c6ce76bbd2f8482560385986d927eb43b03

blackfriday fork with a few changes

go fmt
Vytautas Ĺ altenis vytas@rtfb.lt
Sun, 26 Jan 2014 21:21:25 +0200
commit

31a96c6ce76bbd2f8482560385986d927eb43b03

parent

f2d43f69a49fc75aa738627de774597242072fc0

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M html.gohtml.go

@@ -42,7 +42,7 @@ HTML_SMARTYPANTS_LATEX_DASHES // enable LaTeX-style dashes (with HTML_USE_SMARTYPANTS)

) var ( - tags = []string{ + tags = []string{ "b", "blockquote", "code",

@@ -70,10 +70,10 @@ "strong",

"strike", "ul", } - urlRe = `((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+` + urlRe = `((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+` tagWhitelist = regexp.MustCompile(`^(<\/?(` + strings.Join(tags, "|") + `)>|<(br|hr)\s?\/?>)$`) - anchorClean = regexp.MustCompile(`^(<a\shref="` + urlRe + `"(\stitle="[^"<>]+")?\s?>|<\/a>)$`) - imgClean = regexp.MustCompile(`^(<img\ssrc="` + urlRe + `"(\swidth="\d{1,3}")?(\sheight="\d{1,3}")?(\salt="[^"<>]*")?(\stitle="[^"<>]*")?\s?\/?>)$`) + anchorClean = regexp.MustCompile(`^(<a\shref="` + urlRe + `"(\stitle="[^"<>]+")?\s?>|<\/a>)$`) + imgClean = regexp.MustCompile(`^(<img\ssrc="` + urlRe + `"(\swidth="\d{1,3}")?(\sheight="\d{1,3}")?(\salt="[^"<>]*")?(\stitle="[^"<>]*")?\s?\/?>)$`) ) // Html is a type that implements the Renderer interface for HTML output.