File tree Expand file tree Collapse file tree 2 files changed +11
-18
lines changed Expand file tree Collapse file tree 2 files changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -83,19 +83,6 @@ 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 ) \* \* ` E x p e r i m e n t a l ` \* \* [ \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 ) # # E x a m p l e \r ? \n (?: \r ? \n ) ? ` ` ` t s x [ \s \S ] * ?C l e r k P r o v i d e r \s + c l e r k J s V e r s i o n = " [ ^ " ] * " [ \s \S ] * ?` ` ` (?: \r ? \n ) ? / g,
97
- replace : '' ,
98
- } ,
99
86
{
100
87
pattern : / \( s e t A c t i v e P a r a m s \) / g,
101
88
replace : '([setActiveParams](/docs/references/javascript/types/set-active-params))' ,
Original file line number Diff line number Diff line change @@ -52,12 +52,18 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
52
52
* @param {{ headingLevel?: number; showSummary?: boolean; showTags?: boolean; showReturns?: boolean; isTableColumn?: boolean } } [options]
53
53
*/
54
54
comment : ( model , options ) => {
55
- if ( model ?. modifierTags . has ( '@experimental' ) ) {
56
- const originalBlockTags = model . blockTags ;
57
- model . blockTags = model . blockTags . filter ( tag => tag . name !== '@example' ) ;
55
+ if (
56
+ model . hasModifier ( '@experimental' ) &&
57
+ [ ReflectionKind . Class , ReflectionKind . Interface ] . includes ( this . page ?. model ?. kind )
58
+ ) {
59
+ model . removeModifier ( '@experimental' ) ;
60
+ model . removeTags ( '@example' ) ;
61
+ model . removeTags ( '@see' ) ;
62
+
58
63
const res = superPartials . comment ( model , options ) ;
59
- model . blockTags = originalBlockTags ;
60
- return res ;
64
+
65
+ const [ line , ...linesToInclude ] = res . replace ( / ^ \n \n / , '' ) . split ( '\n' ) ;
66
+ return linesToInclude . join ( '\n' ) ;
61
67
}
62
68
return superPartials . comment ( model , options ) ;
63
69
} ,
You can’t perform that action at this time.
0 commit comments