"use strict";
const htmlparser = require("htmlparser2");
const loadSyntax = require("postcss-syntax/load-syntax");
function iterateCode (source, onStyleTag, onStyleAttribute) {
const openTag = {};
let disable;
let style;
const parser = new htmlparser.Parser({
oncomment: (data) => {
if (!/(?:^|\s+)postcss-(\w+)(?:\s+|$)/i.test(data)) {
return;
}
data = RegExp.$1.toLowerCase();
if (data === "enable") {
disable = false;
} else if (data === "disable") {
disable = true;
}
},
onopentag (name, attribute) {
openTag[name] = true;
// Test if current tag is a valid