Remove error message for using Markdown component (#7343)

This commit is contained in:
Matthew Phillips 2023-06-09 07:41:08 +03:00 committed by GitHub
parent e3271f8c16
commit 3d9a392a09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/markdown-component': patch
---
Fix Markdown component error message false positive

View file

@ -3,13 +3,6 @@ export interface Props {
content?: string;
}
// NOTE(fks): We are most likely moving this component out of Astro core
// in a few weeks. Checking the name like this is a bit of a hack, but we
// intentionally don't want to add an SSR flag for others to read from, just yet.
if (Astro.redirect.name !== '_onlyAvailableInSSR') {
console.error(`\x1B[31mThe <Markdown> component is not available in SSR. See https://github.com/withastro/rfcs/discussions/179 for more info.\x1B[39m`);
}
const dedent = (str: string) => {
const _str = str.split('\n').filter(s => s.trimStart().length > 0);
if (_str.length === 0) {
@ -24,6 +17,7 @@ const dedent = (str: string) => {
// Internal props that should not be part of the external interface.
interface InternalProps extends Props {
class: string;
$scope: string;
}