Skip to content

Commit

Permalink
fix: ensure attribute value is string when checking if it's a url
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Nov 19, 2024
1 parent 7d74dd2 commit b625378
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const plugin = (options = {}) => tree => {

const handleSingleValueAttributes = (node, attribute, value) => {
// Don't prepend to URLs
if (isUrl(node.attrs[attribute])) {
if (typeof node.attrs[attribute] === 'string' && isUrl(node.attrs[attribute])) {
return node
}

Expand Down

0 comments on commit b625378

Please sign in to comment.