|
1 | | -// @ts-check |
| 1 | +// @ts-check - Enable TypeScript checks for safer MDX post-processing and link rewriting |
2 | 2 | import { MarkdownPageEvent } from 'typedoc-plugin-markdown'; |
3 | 3 |
|
4 | 4 | /** |
@@ -83,6 +83,19 @@ function getRelativeLinkReplacements() { |
83 | 83 |
|
84 | 84 | function getCatchAllReplacements() { |
85 | 85 | return [ |
| 86 | + // Robustly remove the full Experimental section (including optional Example/code block) |
| 87 | + // from the first "**`Experimental`**" until the next heading (## ...) or end of file. |
| 88 | + // This covers variations in wording/whitespace and ensures the block is stripped. |
| 89 | + { |
| 90 | + pattern: /(?:^|\r?\n)\*\*`Experimental`\*\*[\s\S]*?(?=(?:\r?\n##\s)|$)/g, |
| 91 | + replace: '', |
| 92 | + }, |
| 93 | + // As a safeguard, remove any leftover Example section that specifically shows ClerkProvider clerkJsVersion snippet |
| 94 | + { |
| 95 | + pattern: |
| 96 | + /(?:^|\r?\n)## Example\r?\n(?:\r?\n)?```tsx[\s\S]*?ClerkProvider\s+clerkJsVersion="[^"]*"[\s\S]*?```(?:\r?\n)?/g, |
| 97 | + replace: '', |
| 98 | + }, |
86 | 99 | { |
87 | 100 | pattern: /\(setActiveParams\)/g, |
88 | 101 | replace: '([setActiveParams](/docs/references/javascript/types/set-active-params))', |
@@ -135,12 +148,6 @@ function getCatchAllReplacements() { |
135 | 148 | pattern: /\*\*Deprecated\*\*/g, |
136 | 149 | replace: '**Deprecated.**', |
137 | 150 | }, |
138 | | - // Remove the standard experimental API notice block (with or without leading/trailing whitespace or newlines) |
139 | | - { |
140 | | - pattern: |
141 | | - /(?:\r?\n)?\*\*`Experimental`\*\*\r?\n\r?\nThis is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change\.\r?\nIt is advised to pin the SDK version to avoid breaking changes\.\r?\n?/g, |
142 | | - replace: '', |
143 | | - }, |
144 | 151 | { |
145 | 152 | /** |
146 | 153 | * By default, `@default` is output with "**Default** `value`". We want to capture the value and place it inside "Defaults to `value`." |
|
0 commit comments