Skip to content

Commit

Permalink
fix: issue with removing attributes from non html elements
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Aug 27, 2019
1 parent 04bcf1f commit ad05146
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export function getVisualAttributes(el: Element) {

if (
!(
(el.localName === "a" && /^(?:xmlns:)?href$/i.test(name)) ||
/^(?:class|id|style|lang|target|xmlns(?::.+)?|xlink:(?!href).+|xml:(?:lang|base)|on*|aria-*|data-*)$/i.test(
(/^(?:xlink:)?href$/i.test(name) && el.localName !== "a" && el.localName !== "use") ||
/^(?:class|id|style|lang|target|xmlns(?::.+)?|xlink:.+|xml:(?:lang|base)|on.+|(?:aria|data)-.+)$/i.test(
name
)
)
Expand Down

0 comments on commit ad05146

Please sign in to comment.