diff --git a/packages/astro/src/runtime/astro.ts b/packages/astro/src/runtime/astro.ts index a525a0d3f9..513ddd890e 100644 --- a/packages/astro/src/runtime/astro.ts +++ b/packages/astro/src/runtime/astro.ts @@ -21,6 +21,6 @@ export async function renderToString(result: any, componentFactory: AstroCompone export async function renderPage(result: any, Component: AstroComponentFactory, props: any, children: any) { const template = await renderToString(result, Component, props, children); const styles = Array.from(result.styles).map((style) => ``); - const scripts = Array.from(result.scripts); + const scripts = Array.from(result.scripts).map((script) => ``); return template.replace('', styles.join('\n') + scripts.join('\n') + ''); } diff --git a/packages/markdown/remark/src/codeblock.ts b/packages/markdown/remark/src/codeblock.ts index 3e471ed651..36af32e264 100644 --- a/packages/markdown/remark/src/codeblock.ts +++ b/packages/markdown/remark/src/codeblock.ts @@ -23,7 +23,7 @@ export function rehypeCodeBlock() { const escapeCode = (code: Element): void => { code.children = code.children.map((child) => { if (child.type === 'text') { - return { ...child, value: child.value.replace(/\{/g, '{') }; + return { ...child, value: `{\`${child.value.replace(/\$\{/g, '\\$\\{').replace(/`/g, '\\`')}\`}` }; } return child; }); diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index dc043bd7a9..9d6d6305b9 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -29,7 +29,7 @@ export const DEFAULT_REMARK_PLUGINS = [ 'remark-gfm', 'remark-footnotes', // TODO: reenable smartypants! - '@silvenon/remark-smartypants' + // '@silvenon/remark-smartypants' ] export const DEFAULT_REHYPE_PLUGINS = [ diff --git a/packages/markdown/remark/src/rehype-jsx.ts b/packages/markdown/remark/src/rehype-jsx.ts index dab12f2e62..4e537f3afa 100644 --- a/packages/markdown/remark/src/rehype-jsx.ts +++ b/packages/markdown/remark/src/rehype-jsx.ts @@ -16,6 +16,8 @@ export default function rehypeJsx(): any { let attr = entry.value; if (attr && typeof attr === 'object') { attr = `{${attr.value}}` + } else if (attr === null) { + attr = `{true}` } return Object.assign(acc, { [entry.name]: attr }); }, {})