@readme/markdown 14.10.2 → 14.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,14 +7,15 @@ import type { Plugin } from 'unified';
7
7
  * Runs after `mdxishComponentBlocks`, which skips paragraph-parented html
8
8
  * nodes and leaves them for this pass. Two producers put html nodes inside
9
9
  * paragraphs:
10
- * 1. The `mdxComponent` text tokenizer, for lowercase tags with `{…}`
11
- * attribute expressions (e.g. `<a href={url}>here</a>`).
10
+ * 1. The `mdxComponent` text tokenizer, for lowercase tags and inline
11
+ * PascalCase components (Anchor, Glossary) with `{}` attribute
12
+ * expressions (e.g. `<a href={url}>here</a>`, `<Anchor href={url}>x</Anchor>`).
12
13
  * 2. CommonMark's built-in html-text tokenizer, for PascalCase components
13
14
  * (e.g. a single html node for self-closing `<C />`).
14
15
  *
15
- * Eligibility mirrors `mdxishComponentBlocks`: lowercase tags only promote
16
- * when they carry an expression attribute; plain inline HTML like
17
- * `<a href="x">` stays as an html node for rehype-raw.
16
+ * Eligibility mirrors `mdxishComponentBlocks`: a tag only promotes when it
17
+ * carries an expression attribute and isn't a non-inline PascalCase component;
18
+ * plain inline HTML like `<a href="x">` stays as an html node for rehype-raw.
18
19
  */
19
20
  declare const mdxishInlineMdxHtmlBlocks: Plugin<[{
20
21
  safeMode?: boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Removes JSX-style comments (e.g., { /* comment *\/ }) from content.
3
+ *
4
+ * `@param` content
5
+ * `@returns` Content with JSX comments removed
6
+ * `@example`
7
+ * ```typescript
8
+ * removeJSXComments('Text {/* comment *\/} more text') // => 'Text more text'
9
+ * ```
10
+ */
11
+ export declare function removeJSXComments(content: string): string;
@@ -0,0 +1,13 @@
1
+ import type { ImportDeclaration } from 'estree';
2
+ export type ModuleRegistry = Record<string, unknown>;
3
+ export declare const defaultModuleRegistry: ModuleRegistry;
4
+ /**
5
+ * Turn `import` declarations into a flat map of binding → value.
6
+ *
7
+ * A "binding" is a mapping of a local name to the value of it in the module exports
8
+ * Example: `import { useState } from 'react'` yields `{ useState: React.useState }`.
9
+ *
10
+ * Unsupported specifiers are skipped with a warning rather than throwing, so a
11
+ * single unknown import can't break the rest of the document.
12
+ */
13
+ export declare const collectImportValues: (importDeclarations: ImportDeclaration[], registry?: ModuleRegistry) => Record<string, unknown>;