|
|
@@ -332,7 +332,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
this.baseURI = this.options.url = resourceURL;
|
|
|
}
|
|
|
this.doc = DocUtil.createDoc(pageContent, this.baseURI);
|
|
|
- this.onEventAttributeNames = DocUtil.getOnEventAttributeNames(this.doc);
|
|
|
+ this.onEventAttributeNames = Util.getOnEventAttributeNames(this.doc);
|
|
|
}
|
|
|
|
|
|
async getPageData() {
|
|
|
@@ -1487,6 +1487,17 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ static getOnEventAttributeNames(doc) {
|
|
|
+ const element = doc.createElement("div");
|
|
|
+ const attributeNames = [];
|
|
|
+ for (const propertyName in element) {
|
|
|
+ if (propertyName.startsWith("on")) {
|
|
|
+ attributeNames.push(propertyName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return attributeNames;
|
|
|
+ }
|
|
|
+
|
|
|
static async evalTemplateVariable(template, variableName, valueGetter, dontReplaceSlash) {
|
|
|
const replaceRegExp = new RegExp("{\\s*" + variableName + "\\s*}", "g");
|
|
|
if (template.match(replaceRegExp)) {
|