Skip to content
Snippets Groups Projects
Commit cc1954fb authored by Jeff Geerling's avatar Jeff Geerling Committed by Lachlan Ennis
Browse files

Issue #2670902 by geerlingguy: SVG xlink:href breaks Extlink JS


Signed-off-by: default avatarelachlan <elachlan@1021502.no-reply.drupal.org>
parent 82a9d4f4
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,13 @@ Drupal.extlink.attach = function (context, settings) {
var mailto_links = new Array();
$("a:not(." + settings.extlink.extClass + ", ." + settings.extlink.mailtoClass + "), area:not(." + settings.extlink.extClass + ", ." + settings.extlink.mailtoClass + ")", context).each(function(el) {
try {
var url = this.href.toLowerCase();
if (typeof this.href == 'string') {
var url = this.href.toLowerCase();
}
// Handle SVG links (xlink:href).
else if (typeof this.href == 'object') {
var url = this.href.baseVal;
}
if (url.indexOf('http') == 0
&& ((!url.match(internal_link) && !(extExclude && url.match(extExclude))) || (extInclude && url.match(extInclude)))
&& !(extCssExclude && $(this).parents(extCssExclude).length > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment