mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
fix: handle all html rules properly
This commit is contained in:
parent
4df140d1b7
commit
a27e904309
2 changed files with 3 additions and 4 deletions
|
@ -155,7 +155,6 @@ export const htmlRules: {
|
|||
|
||||
// srcset
|
||||
srcset: ["img", "source"],
|
||||
srcSet: ["img", "source"],
|
||||
imagesrcset: ["link"],
|
||||
},
|
||||
{
|
||||
|
@ -200,7 +199,7 @@ function traverseParsedHtml(
|
|||
if (node.attribs) {
|
||||
for (const rule of htmlRules) {
|
||||
for (const attr in rule) {
|
||||
const sel = rule[attr];
|
||||
const sel = rule[attr.toLowerCase()];
|
||||
if (typeof sel === "function") continue;
|
||||
|
||||
if (sel === "*" || sel.includes(node.name)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue