vaderjs 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vader.js +21 -8
- package/vaderRouter.js +1 -3
package/package.json
CHANGED
package/vader.js
CHANGED
|
@@ -181,8 +181,18 @@ export class Component {
|
|
|
181
181
|
},
|
|
182
182
|
});
|
|
183
183
|
this.snapshots = [];
|
|
184
|
+
|
|
184
185
|
}
|
|
185
186
|
|
|
187
|
+
/**
|
|
188
|
+
* @method adapter
|
|
189
|
+
* @description Allows you to create an adapter - this is used to create custom logic
|
|
190
|
+
*
|
|
191
|
+
*
|
|
192
|
+
*/
|
|
193
|
+
adapter() {
|
|
194
|
+
return
|
|
195
|
+
}
|
|
186
196
|
init() {
|
|
187
197
|
this.registerComponent();
|
|
188
198
|
}
|
|
@@ -860,8 +870,10 @@ export class Component {
|
|
|
860
870
|
throw new SyntaxError(
|
|
861
871
|
`Image: ${element.outerHTML} alt attribute cannot be empty`
|
|
862
872
|
);
|
|
873
|
+
|
|
863
874
|
} else if (
|
|
864
875
|
element.hasAttribute("src") &&
|
|
876
|
+
!element.getAttribute("src")?.includes("http") || !element.getAttribute("src")?.includes("https") &&
|
|
865
877
|
!document.documentElement.outerHTML
|
|
866
878
|
.trim()
|
|
867
879
|
.includes("<!-- #vader-disable_accessibility -->")
|
|
@@ -955,16 +967,17 @@ export class Component {
|
|
|
955
967
|
}
|
|
956
968
|
|
|
957
969
|
if (
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
.
|
|
963
|
-
|
|
970
|
+
element.hasAttribute("src") &&
|
|
971
|
+
// @ts-ignore
|
|
972
|
+
!element.getAttribute("src").includes("http") &&
|
|
973
|
+
// @ts-ignore
|
|
974
|
+
!element.getAttribute("src").includes("https") &&
|
|
975
|
+
!document.documentElement.outerHTML.includes(`<!-- #vader-disable_relative-paths -->`)
|
|
964
976
|
) {
|
|
965
977
|
element.setAttribute(
|
|
966
978
|
"src",
|
|
967
|
-
|
|
979
|
+
// @ts-ignore
|
|
980
|
+
`./public/${element.getAttribute("src")}`
|
|
968
981
|
);
|
|
969
982
|
}
|
|
970
983
|
break;
|
|
@@ -1124,4 +1137,4 @@ export const include = async (path) => {
|
|
|
1124
1137
|
});
|
|
1125
1138
|
};
|
|
1126
1139
|
|
|
1127
|
-
export default Vader
|
|
1140
|
+
export default Vader;
|