From aab61220a6029c7ac329735bd47a08d6ae229827 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 20 Jul 2022 09:36:00 -0400 Subject: [PATCH 1/6] Remove references to the component --- src/pages/en/guides/markdown-content.md | 89 +------------------ src/pages/en/reference/api-reference.md | 19 ---- .../en/reference/directives-reference.md | 2 - 3 files changed, 1 insertion(+), 109 deletions(-) diff --git a/src/pages/en/guides/markdown-content.md b/src/pages/en/guides/markdown-content.md index 60f6ab4c7e48a..c4e00ccef449f 100644 --- a/src/pages/en/guides/markdown-content.md +++ b/src/pages/en/guides/markdown-content.md @@ -341,93 +341,6 @@ const { Content } = Astro.props.post ``` -## Markdown Component - -:::caution[Deprecated] -The `` component does not work in SSR and will be moved to its own package before v1.0. Consider [importing Markdown content](/en/guides/markdown-content/#importing-markdown) instead. -::: - -You can import the [built-in Astro Markdown component](/en/reference/api-reference/#markdown-) in your component script and then write any Markdown you want between `` tags. - -````astro ---- -import { Markdown } from 'astro/components'; -import Layout from '../layouts/Layout.astro'; - -const expressions = 'Lorem ipsum'; ---- - - - # Hello world! - - **Everything** supported in a `.md` file is also supported here! - - There is _zero_ runtime overhead. - - In addition, Astro supports: - - Astro {expressions} - - Automatic indentation normalization - - Automatic escaping of expressions inside code blocks - - ```js - // This content is not transformed! - const object = { someOtherValue }; - ``` - - - Rich component support like any `.astro` file! - - Recursive Markdown support (Component children are also processed as Markdown) - - -```` - -### Remote Markdown - -:::caution[Deprecated] -The `` component does not work in SSR and will be moved to its own package before v1.0. Consider [importing Markdown content](/en/guides/markdown-content/#importing-markdown) instead. -::: - -If you have Markdown in a remote source, you may pass it directly to the Markdown component through the `content` attribute. - -```astro ---- -import { Markdown } from 'astro/components'; - -const content = await fetch('https://raw.githubusercontent.com/withastro/docs/main/README.md').then(res => res.text()); ---- - - - -``` - -### Nested Markdown - -:::caution[Deprecated] -The `` component does not work in SSR and will be moved to its own package before v1.0. Consider [importing Markdown content](/en/guides/markdown-content/#importing-markdown) instead. -::: - -`` components can be nested. - -```astro ---- -import { Markdown } from 'astro/components'; - -const content = await fetch('https://raw.githubusercontent.com/withastro/docs/main/README.md').then(res => res.text()); ---- - - - - ## Markdown example - - Here we have some __Markdown__ code. We can also dynamically render remote content. - - - - -``` - -:::caution -Use of the `Markdown` component to render remote Markdown can open you up to a [cross-site scripting (XSS)](https://en.wikipedia.org/wiki/Cross-site_scripting) attack. If you are rendering untrusted content, be sure to _sanitize your content **before** rendering it_. -::: ## Configuring Markdown @@ -487,7 +400,7 @@ By default, Astro comes with [GitHub-flavored Markdown](https://github.com/remar Astro comes with built-in support for [Shiki](https://shiki.matsu.io/) and [Prism](https://prismjs.com/). This provides instant syntax highlighting for: -- all code fences (\`\`\`) used in a markdown (`.md`) file and the [built-in `` component](#markdown-component). +- all code fences (\`\`\`) used in a markdown (`.md`) file. - content within the [built-in `` component](/en/reference/api-reference/#code-) (powered by Shiki), or the [`` component](/en/reference/api-reference/#prism-) (powered by Prism). Shiki is enabled by default, preconfigured with the `github-dark` theme. The compiled output will be limited to inline `style`s without any extraneous CSS classes, stylesheets, or client-side JS. diff --git a/src/pages/en/reference/api-reference.md b/src/pages/en/reference/api-reference.md index e2b7c0f844e0c..b7103589d4853 100644 --- a/src/pages/en/reference/api-reference.md +++ b/src/pages/en/reference/api-reference.md @@ -461,25 +461,6 @@ export default function () { Astro includes several built-in components for you to use in your projects. All built-in components are available in `.astro` files via `import {} from 'astro/components';`. -### `` - -:::caution[Deprecated] -The `` component does not work in SSR and will be moved to its own package before v1.0. Consider [importing Markdown content](/en/guides/markdown-content/#importing-markdown) instead. -::: - -```astro ---- -import { Markdown } from 'astro/components'; ---- - - # Markdown syntax is now supported! **Yay!** - -``` - -See our [Markdown Guide](/en/guides/markdown-content/) for more info. - - - ### `` ```astro diff --git a/src/pages/en/reference/directives-reference.md b/src/pages/en/reference/directives-reference.md index 0886f6f1b42e2..f79107a12d18f 100644 --- a/src/pages/en/reference/directives-reference.md +++ b/src/pages/en/reference/directives-reference.md @@ -221,8 +221,6 @@ Using `define:vars` on a `