Add rel="noopener" to external links

Fixes #4764
This commit is contained in:
Francis Lachapelle committed 2019-06-10 13:20:44 -04:00
1 parent 3129e149df
commit 0e918a446a
7 files changed
+8 -5

No files matched your search

+1 -1
View File
@@ -184,7 +184,7 @@ static int cssEscapingCount;
{
rangePtr->location += offset;
urlText = [selfCopy substringFromRange: *rangePtr];
newUrlText = [NSString stringWithFormat: @"<a href=\"%@%@\">%@</a>",
newUrlText = [NSString stringWithFormat: @"<a rel=\"noopener\" href=\"%@%@\">%@</a>",
([urlText hasPrefix: prefix]? @"" : prefix),
urlText, urlText];
[selfCopy replaceCharactersInRange: *rangePtr