You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running anchorme.default, if an anchor has an href with a port and the text for the anchor has the URL without the port, a new anchor is created inside the original anchor, but the port is not in the nested anchor.
When running anchorme.default, if an anchor has an href with a port and the text for the anchor has the URL without the port, a new anchor is created inside the original anchor, but the port is not in the nested anchor.
See http://jsfiddle.net/tmmiller/cr4a6kqe/4/
document.getElementById("input").value =
<div><a href="https://mywebsite.com:7743" target="_blank">https://mywebsite.com</a></div>
;function process() {
document.getElementById("output").value = anchorme({
input: document.getElementById("input").value,
options: {
attributes: function(string) {
const attributes = {
target: "_blank",
rel: 'noopener noreferrer nofollow'
};
return attributes;
}
},
});
}
process();
Expected result: The target and rel attributes added to the anchor
Actual result: Notice the new anchor created without the port
The text was updated successfully, but these errors were encountered: