@@ -10,6 +10,7 @@ addTests('__urls_that_dont_match__', [
10
10
'https://github.com/sindresorhus/refined-github/issues/new' ,
11
11
'https://github.com/sindresorhus/refined-github/issues/new/choose' ,
12
12
'https://github.com/sindresorhus/refined-github/issues/templates/edit' ,
13
+ 'https://github.com/orgs/community/discussions/new/choose' ,
13
14
] ) ;
14
15
15
16
export const is404 = ( ) : boolean => / ^ ( P a g e | F i l e ) n o t f o u n d · G i t H u b / . test ( document . title ) ; // #98; When logged out, it starts with "File"
@@ -213,6 +214,12 @@ addTests('isDiscussion', [
213
214
'https://github.com/orgs/community/discussions/11202' ,
214
215
] ) ;
215
216
217
+ export const isNewDiscussion = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'discussions/new' || getOrg ( url ) ?. path === 'discussions/new' ;
218
+ addTests ( 'isNewDiscussion' , [
219
+ 'https://github.com/withastro/roadmap/discussions/new?category=proposal' ,
220
+ 'https://github.com/orgs/community/discussions/new?category=pull-requests' ,
221
+ ] ) ;
222
+
216
223
export const isDiscussionList = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'discussions' || getOrg ( url ) ?. path === 'discussions' ;
217
224
addTests ( 'isDiscussionList' , [
218
225
'https://github.com/tophf/mpiv/discussions' ,
@@ -654,7 +661,8 @@ export const hasRichTextEditor = (url: URL | HTMLAnchorElement | Location = loca
654
661
|| isCompare ( url )
655
662
|| isRepliesSettings ( url )
656
663
|| hasReleaseEditor ( url )
657
- || isDiscussion ( url ) ;
664
+ || isDiscussion ( url )
665
+ || isNewDiscussion ( url ) ;
658
666
659
667
addTests ( 'hasCode' , combinedTestOnly ) ;
660
668
/** Static code, not the code editor */
0 commit comments