Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/componentFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('<a %s href="%s"%s>%s</a>', 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('<a %s href="%s"%s>%s</a>', hrefAttrs, element.attr('href'), target, inner);
}

// If the button is expanded, it needs a <center> tag around the content
Expand Down Expand Up @@ -102,7 +107,12 @@ module.exports = function(element) {
if (element.attr('class')) {
classes = classes.concat(element.attr('class').split(' '));
}
return format('<th %s class="%s"><a href="%s"%s>%s</a></th>', 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('<th %s class="%s"><a %s href="%s"%s>%s</a></th>', attrs, classes.join(' '), hrefAttrs, element.attr('href'), target, inner);

// <center>
case this.components.center:
Expand Down