Skip to content

Commit

Permalink
Merge branch 'main' into fix/node-in-prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Sullivan authored Jul 25, 2022
2 parents 7d73857 + ab8f490 commit 70ced7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ export interface AstroUserConfig {
* @name Legacy Flags
* @description
* To help some users migrate between versions of Astro, we occasionally introduce `legacy` flags.
* These flags let you to opt-in to some deprecated or otherwise outdated behavior of Astro
* These flags allow you to opt in to some deprecated or otherwise outdated behavior of Astro
* in the latest version, so that you can continue to upgrade and take advantage of new Astro releases.
*/
legacy?: {
Expand All @@ -719,7 +719,7 @@ export interface AstroUserConfig {
* @name legacy.astroFlavoredMarkdown
* @type {boolean}
* @default `false`
* @since 1.0.0-rc
* @version 1.0.0-rc.1
* @description
* Enable Astro's pre-v1.0 support for components and JSX expressions in `.md` Markdown files.
* In Astro `1.0.0-rc`, this original behavior was removed as the default, in favor of our new [MDX integration](/en/guides/integrations-guide/mdx/).
Expand Down
12 changes: 8 additions & 4 deletions packages/astro/src/vite-plugin-markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import matter from 'gray-matter';
import { fileURLToPath } from 'url';
import type { Plugin } from 'vite';
import type { AstroConfig } from '../@types/astro';
import type { LogOptions } from '../core/logger/core.js';
import { pagesVirtualModuleId } from '../core/app/index.js';
import { collectErrorMetadata } from '../core/errors.js';
import type { LogOptions } from '../core/logger/core.js';
import { warn } from '../core/logger/core.js';
import { resolvePages } from '../core/util.js';
import { cachedCompilation, CompileProps } from '../vite-plugin-astro/compile.js';
import { getViteTransform, TransformHook } from '../vite-plugin-astro/styles.js';
import type { PluginMetadata as AstroPluginMetadata } from '../vite-plugin-astro/types';
import { PAGE_SSR_SCRIPT_ID } from '../vite-plugin-scripts/index.js';
import { getFileInfo } from '../vite-plugin-utils/index.js';
import { warn } from '../core/logger/core.js';

interface AstroPluginOptions {
config: AstroConfig;
Expand Down Expand Up @@ -175,8 +175,12 @@ export default function markdown({ config, logging }: AstroPluginOptions): Plugi
content.file = filename;

// Warn when attempting to use setup without the legacy flag
if(setup && !isAstroFlavoredMd) {
warn(logging, 'markdown', `The setup: property in frontmatter only works with the legacy.astroFlavoredMarkdown flag enabled.`);
if (setup && !isAstroFlavoredMd) {
warn(
logging,
'markdown',
`The setup: property in frontmatter only works with the legacy.astroFlavoredMarkdown flag enabled.`
);
}

const prelude = `---
Expand Down

0 comments on commit 70ced7e

Please sign in to comment.