|
1 | | -import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark'; |
2 | 1 | import type { |
3 | 2 | AstroGlobal, |
4 | 3 | AstroGlobalPartial, |
@@ -27,10 +26,6 @@ export interface CreateResultArgs { |
27 | 26 | */ |
28 | 27 | ssr: boolean; |
29 | 28 | logging: LogOptions; |
30 | | - /** |
31 | | - * Used to support `Astro.__renderMarkdown` for legacy `<Markdown />` component |
32 | | - */ |
33 | | - markdown: MarkdownRenderingOptions; |
34 | 29 | params: Params; |
35 | 30 | pathname: string; |
36 | 31 | renderers: SSRLoadedRenderer[]; |
@@ -128,10 +123,8 @@ class Slots { |
128 | 123 | } |
129 | 124 | } |
130 | 125 |
|
131 | | -let renderMarkdown: any = null; |
132 | | - |
133 | 126 | export function createResult(args: CreateResultArgs): SSRResult { |
134 | | - const { markdown, params, request, resolve, locals } = args; |
| 127 | + const { params, request, resolve, locals } = args; |
135 | 128 |
|
136 | 129 | const url = new URL(request.url); |
137 | 130 | const headers = new Headers(); |
@@ -222,31 +215,6 @@ export function createResult(args: CreateResultArgs): SSRResult { |
222 | 215 | slots: astroSlots as unknown as AstroGlobal['slots'], |
223 | 216 | }; |
224 | 217 |
|
225 | | - Object.defineProperty(Astro, '__renderMarkdown', { |
226 | | - // Ensure this API is not exposed to users |
227 | | - enumerable: false, |
228 | | - writable: false, |
229 | | - // TODO: Remove this hole "Deno" logic once our plugin gets Deno support |
230 | | - value: async function (content: string, opts: MarkdownRenderingOptions) { |
231 | | - // @ts-expect-error |
232 | | - if (typeof Deno !== 'undefined') { |
233 | | - throw new Error('Markdown is not supported in Deno SSR'); |
234 | | - } |
235 | | - |
236 | | - if (!renderMarkdown) { |
237 | | - // The package is saved in this variable because Vite is too smart |
238 | | - // and will try to inline it in buildtime |
239 | | - let astroRemark = '@astrojs/'; |
240 | | - astroRemark += 'markdown-remark'; |
241 | | - |
242 | | - renderMarkdown = (await import(astroRemark)).renderMarkdown; |
243 | | - } |
244 | | - |
245 | | - const { code } = await renderMarkdown(content, { ...markdown, ...(opts ?? {}) }); |
246 | | - return code; |
247 | | - }, |
248 | | - }); |
249 | | - |
250 | 218 | return Astro; |
251 | 219 | }, |
252 | 220 | resolve, |
|
0 commit comments