diff --git a/lib/componentFactory.js b/lib/componentFactory.js index 664f552..42c8a85 100644 --- a/lib/componentFactory.js +++ b/lib/componentFactory.js @@ -45,7 +45,12 @@ module.exports = function(element) { // If we have the href attribute we can create an anchor for the inner of the button; if (element.attr('href')) { - inner = format('%s', attrs, element.attr('href'), target, inner); + // support for all types of href- attributes for inner link (e.g. Sendgrid's clicktracking="off") + var hrefAttrs = attrs.split(' ') + .filter(attr => attr.startsWith('href-')) + .map(attr => ' '+attr.replace('href-','')) + .join(); + inner = format('%s', hrefAttrs, element.attr('href'), target, inner); } // If the button is expanded, it needs a
tag around the content @@ -102,7 +107,12 @@ module.exports = function(element) { if (element.attr('class')) { classes = classes.concat(element.attr('class').split(' ')); } - return format('%s', attrs, classes.join(' '), element.attr('href'), target, inner); + // support for all types of href- attributes for inner link (e.g. Sendgrid's clicktracking="off") + var hrefAttrs = attrs.split(' ') + .filter(attr => attr.startsWith('href-')) + .map(attr => ' '+attr.replace('href-','')) + .join(); + return format('%s', attrs, classes.join(' '), hrefAttrs, element.attr('href'), target, inner); //
case this.components.center: