Refactor code to remove unnecessary elements in sanitize allowElements
This commit is contained in:
parent
9f89f2e4e4
commit
c494ecaf3d
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
"@matthiesenxyz/astro-ghostcms-brutalbyelian": patch
|
||||||
|
"@matthiesenxyz/astro-ghostcms-theme-default": patch
|
||||||
|
"@matthiesenxyz/astro-ghostcms-catppuccin": patch
|
||||||
|
"@matthiesenxyz/starlight-ghostcms": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix html rendering to allow custom components
|
|
@ -34,7 +34,6 @@ invariant(settings, "Settings are required");
|
||||||
content={post.html}
|
content={post.html}
|
||||||
sanitize={{
|
sanitize={{
|
||||||
allowComponents: true,
|
allowComponents: true,
|
||||||
allowElements: ['a', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'figure', 'figcaption', 'ul', 'ol', 'li', 'blockquote', 'pre', 'code', 'em', 'strong', 'del', 'hr', 'br', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'caption', 'div', 'span', 'script', 'astrocard'],
|
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
h1: C.H1,
|
h1: C.H1,
|
||||||
|
|
|
@ -34,7 +34,6 @@ invariant(settings, "Settings not found");
|
||||||
content={post.html}
|
content={post.html}
|
||||||
sanitize={{
|
sanitize={{
|
||||||
allowComponents: true,
|
allowComponents: true,
|
||||||
allowElements: ['a', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'figure', 'figcaption', 'ul', 'ol', 'li', 'blockquote', 'pre', 'code', 'em', 'strong', 'del', 'hr', 'br', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'caption', 'div', 'span', 'script', 'getgist', 'getgistgroup', 'astrocard'],
|
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
pre: render.CodeSlot
|
pre: render.CodeSlot
|
||||||
|
|
|
@ -30,7 +30,6 @@ const { page, settings, pageClass } = Astro.props as Props;
|
||||||
content={page.html}
|
content={page.html}
|
||||||
sanitize={{
|
sanitize={{
|
||||||
allowComponents: true,
|
allowComponents: true,
|
||||||
allowElements: ['a', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'figure', 'figcaption', 'ul', 'ol', 'li', 'blockquote', 'pre', 'code', 'em', 'strong', 'del', 'hr', 'br', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'caption', 'div', 'span', 'script', 'getgist', 'getgistgroup', 'astrocard'],
|
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
pre: render.CodeSlot
|
pre: render.CodeSlot
|
||||||
|
|
|
@ -22,7 +22,6 @@ invariant(settings, "Settings not found");
|
||||||
content={post.html}
|
content={post.html}
|
||||||
sanitize={{
|
sanitize={{
|
||||||
allowComponents: true,
|
allowComponents: true,
|
||||||
allowElements: ['a', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'figure', 'figcaption', 'ul', 'ol', 'li', 'blockquote', 'pre', 'code', 'em', 'strong', 'del', 'hr', 'br', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'caption', 'div', 'span', 'script', 'getgist', 'getgistgroup', 'astrocard'],
|
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
pre: render.CodeSlot
|
pre: render.CodeSlot
|
||||||
|
|
|
@ -49,7 +49,6 @@ const pageProps = getPageProps(post.title)
|
||||||
content={post.html}
|
content={post.html}
|
||||||
sanitize={{
|
sanitize={{
|
||||||
allowComponents: true,
|
allowComponents: true,
|
||||||
allowElements: ['a', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'figure', 'figcaption', 'ul', 'ol', 'li', 'blockquote', 'pre', 'code', 'em', 'strong', 'del', 'hr', 'br', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'caption', 'div', 'span', 'script', 'getgist', 'getgistgroup', 'astrocard'],
|
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
pre: render.CodeSlot,
|
pre: render.CodeSlot,
|
||||||
|
|
|
@ -12,23 +12,24 @@ const aboutPage = await getSluggedPage("about");
|
||||||
|
|
||||||
//const { entries, nextLink, prevLink } = Astro.props
|
//const { entries, nextLink, prevLink } = Astro.props
|
||||||
|
|
||||||
const pageProps = getPageProps(aboutPage?.post?.title)
|
const pageProps = getPageProps(aboutPage ? aboutPage.post.title : "")
|
||||||
---
|
---
|
||||||
|
|
||||||
<Page {...pageProps}>
|
<Page {...pageProps}>
|
||||||
{config.supportGhost && (
|
{config.supportGhost && (
|
||||||
<div id="pghost">Powered by <a href="https://ghost.org">Ghost</a></div>
|
<div id="pghost">Powered by <a href="https://ghost.org">Ghost</a></div>
|
||||||
)}
|
)}
|
||||||
|
{aboutPage &&
|
||||||
<Metadata entry={aboutPage.post} />
|
<Metadata entry={aboutPage.post} />
|
||||||
<Markup
|
<Markup
|
||||||
content={aboutPage.post.html}
|
content={aboutPage.post.html}
|
||||||
sanitize={{
|
sanitize={{
|
||||||
allowComponents: true,
|
allowComponents: true,
|
||||||
allowElements: ['a', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'figure', 'figcaption', 'ul', 'ol', 'li', 'blockquote', 'pre', 'code', 'em', 'strong', 'del', 'hr', 'br', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'caption', 'div', 'span'],
|
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
pre: render.CodeSlot
|
pre: render.CodeSlot
|
||||||
}} />
|
}} />
|
||||||
|
}
|
||||||
<footer class="not-content">
|
<footer class="not-content">
|
||||||
<!--PrevNextLinks next={nextLink} prev={prevLink} /-->
|
<!--PrevNextLinks next={nextLink} prev={prevLink} /-->
|
||||||
</footer>
|
</footer>
|
||||||
|
|
Loading…
Reference in New Issue