Skip to content

Commit a371968

Browse files
committed
fix: update initElements function to correctly handle 'rendered' attribute and improve src validation
1 parent ce6c03b commit a371968

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/fetchSrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ async function initElements(elements) {
3737
if (element.tagName === "AUDIO" || element.tagName === "VIDEO") {
3838
initMediaSource(element, src);
3939
} else {
40-
if (src && !textExtensions.includes(src.split('.').pop())) return
41-
element.removeAttribute("rendered");
40+
if (src && !textExtensions.includes(src.split('.').pop())) continue
4241

42+
if (element.hasAttribute("rendered")) {
43+
element.removeAttribute("rendered");
44+
// continue;
45+
}
4346
let text = await response.text();
4447
if (text) {
4548
let path = "";

0 commit comments

Comments
 (0)