Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Aug 11, 2023
1 parent 405913c commit 2bdcba2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/astro/components/ViewTransitions.astro
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const { fallback = 'animate' } = Astro.props as Props;
function runScripts() {
let wait = Promise.resolve();
for (const script of Array.from(document.scripts)) {
if(script.dataset.astroExec === '') continue;
if (script.dataset.astroExec === '') continue;
const s = document.createElement('script');
s.innerHTML = script.innerHTML;
for (const attr of script.attributes) {
Expand Down Expand Up @@ -108,14 +108,15 @@ const { fallback = 'animate' } = Astro.props as Props;
const href = el.getAttribute('href');
return doc.head.querySelector(`link[rel=stylesheet][href="${href}"]`);
}
if(el.tagName === 'SCRIPT') {
if (el.tagName === 'SCRIPT') {
let s1 = el as HTMLScriptElement;
for(const s2 of doc.scripts) {
if(
for (const s2 of doc.scripts) {
if (
// Inline
(s1.textContent && s1.textContent === s2.textContent) ||
// External
(s1.type === s2.type && s1.src === s2.src)) {
(s1.type === s2.type && s1.src === s2.src)
) {
return s2;
}
}
Expand Down

0 comments on commit 2bdcba2

Please sign in to comment.