@@ -32,7 +32,7 @@ function emitDom() {
3232
3333 // ${name} will be substituted with the name of an interface
3434 const removeVerboseIntroductions : [ RegExp , string ] [ ] = [
35- [ / ^ ( T h e | A ) $ { name} i n t e r f a c e o f ( t h e \s * ) * ( [ a - z \s ] + A P I ) ( \\ \' s ) ? / , 'An interface of the $3 ' ] ,
35+ [ / ^ ( T h e | A ) $ { name} i n t e r f a c e o f ( t h e \s * ) * ( [ a - z \d \ s] + A P I ) ( \\ \' s ) ? / , 'An interface of the $3 ' ] ,
3636 [ / ^ ( T h e | A ) $ { name} ( i n t e r f a c e | e v e n t | o b j e c t ) ( i s | r e p r e s e n t s | d e s c r i b e s | d e f i n e s ) ? / , '' ] ,
3737 [ / ^ A n o b j e c t i m p l e m e n t i n g t h e $ { name} i n t e r f a c e ( i s | r e p r e s e n t s | d e s c r i b e s | d e f i n e s ) / , '' ] ,
3838 [ / ^ T h e $ { name} i s a n i n t e r f a c e r e p r e s e n t i n g / , '' ] ,
@@ -62,6 +62,7 @@ function emitDom() {
6262 const idl : string = fs . readFileSync ( path . join ( inputFolder , "idl" , filename ) , { encoding : "utf-8" } ) ;
6363 const commentsMapFilePath = path . join ( inputFolder , "idl" , title + ".commentmap.json" ) ;
6464 const commentsMap : Record < string , string > = fs . existsSync ( commentsMapFilePath ) ? require ( commentsMapFilePath ) : { } ;
65+ commentCleanup ( commentsMap )
6566 const result = convert ( idl , commentsMap ) ;
6667 if ( deprecated ) {
6768 mapToArray ( result . browser . interfaces ! . interface ) . forEach ( markAsDeprecated ) ;
@@ -70,6 +71,14 @@ function emitDom() {
7071 return result ;
7172 }
7273
74+ function commentCleanup ( commentsMap : Record < string , string > ) {
75+ for ( const key in commentsMap ) {
76+ // Filters out phrases for nested comments as we retargets them:
77+ // "This operation receives a dictionary, which has these members:"
78+ commentsMap [ key ] = commentsMap [ key ] . replace ( / [ , . ] [ ^ , . ] + : $ / g, "." ) ;
79+ }
80+ }
81+
7382 function apiDescriptionsToIdl ( descriptions : Record < string , string > ) {
7483 const idl : Browser . WebIdl = {
7584 interfaces : {
0 commit comments