next-mdx-remote
Version:
utilities for loading mdx from any remote source as data, rather than as a local import
19 lines (18 loc) • 560 B
TypeScript
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import type { Plugin } from 'unified';
/**
* Remark plugin that removes JavaScript expressions from MDX.
* This blocks patterns like {variable} or {func()} that enable code execution.
*
* Safe patterns (preserved):
* - JSX: <Component />
* - Markdown: # Heading, **bold**, etc.
*
* Blocked patterns:
* - JS expressions: {variable}, {func()}, {obj.prop}
* - JSX attribute expressions: <Component prop={value} />
*/
export declare const removeJavaScriptExpressions: Plugin;