-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from third774/use-og-image-service
Switch over to using og:image generating service
- Loading branch information
Showing
9 changed files
with
827 additions
and
1,809 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/node_modules/astro/dist/runtime/server/render/util.js b/node_modules/astro/dist/runtime/server/render/util.js | ||
index 44fe49e..a55817b 100644 | ||
--- a/node_modules/astro/dist/runtime/server/render/util.js | ||
+++ b/node_modules/astro/dist/runtime/server/render/util.js | ||
@@ -70,6 +70,9 @@ Make sure to use the static attribute syntax (\`${key}={value}\`) instead of the | ||
if (key === "className") { | ||
return markHTMLString(` class="${toAttributeString(value, shouldEscape)}"`); | ||
} | ||
+ if (typeof value === 'string' && value.includes('&') && urlCanParse(value)) { | ||
+ return markHTMLString(` ${key}="${toAttributeString(value, false)}"`); | ||
+ } | ||
if (value === true && (key.startsWith("data-") || htmlBooleanAttributes.test(key))) { | ||
return markHTMLString(` ${key}`); | ||
} else { | ||
@@ -131,6 +134,14 @@ function promiseWithResolvers() { | ||
reject | ||
}; | ||
} | ||
+function urlCanParse(url) { | ||
+ try { | ||
+ new URL(url, 'http://example.com'); | ||
+ return true; | ||
+ } catch { | ||
+ return false; | ||
+ } | ||
+} | ||
export { | ||
addAttribute, | ||
defineScriptVars, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.