Allow rel attribute in sanitizer

Fixes issue #68.
This commit is contained in:
Vytautas Šaltenis 2014-05-01 20:49:49 +03:00
parent b54984b711
commit b44be78459
2 changed files with 4 additions and 4 deletions

View File

@ -524,10 +524,10 @@ func TestInlineLink(t *testing.T) {
func TestNofollowLink(t *testing.T) {
var tests = []string{
"[foo](/bar/)\n",
"<p><a href=\"/bar/\" rel=\"nofollow\">foo</a></p>\n",
"[foo](http://bar.baz/)\n",
"<p><a href=\"http://bar.baz/\" rel=\"nofollow\">foo</a></p>\n",
}
doTestsInlineParam(t, tests, 0, HTML_SAFELINK|HTML_NOFOLLOW_LINKS)
doTestsInlineParam(t, tests, 0, HTML_SAFELINK|HTML_NOFOLLOW_LINKS|HTML_SANITIZE_OUTPUT)
}
func TestSafeInlineLink(t *testing.T) {

View File

@ -26,7 +26,7 @@ func init() {
"sub", "sup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "u",
"ul"})
whitelistAttrs = map[string]map[string]bool{
"a": toSet([]string{"href", "title"}),
"a": toSet([]string{"href", "title", "rel"}),
"img": toSet([]string{"src", "alt", "title"}),
}
protocolAttrs = map[string]map[string]bool{