File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const states: { [state: string]: Rules } = {
55 doubleapos : { match : "''" , value : ( ) => "'" } ,
66 quoted : {
77 lineBreaks : true ,
8- match : / ' [ { } # ] (?: [ ^ ] * ? [ ^ ' ] ) ? ' (? ! ' ) / u,
8+ match : / ' [ { } # ] (?: [ ^ ' ] | ' ' ) * ' (? ! ' ) / u,
99 value : src => src . slice ( 1 , - 1 ) . replace ( / ' ' / g, "'" )
1010 } ,
1111 argument : {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function run(shape: Record<string, any>) {
2626 }
2727}
2828
29- const trimCtx = obj =>
29+ const trimCtx = ( obj : any ) =>
3030 JSON . parse (
3131 JSON . stringify ( obj , ( key , value ) => ( key === 'ctx' ? undefined : value ) )
3232 ) ;
@@ -297,6 +297,23 @@ describe('Plurals', () => {
297297 { type : 'content' , value : 'one' } ,
298298 { type : 'octothorpe' }
299299 ] ) ;
300+ expect ( parse ( "'{' {S, plural, other{# is a '#'}} '}'" ) ) . toMatchObject ( [
301+ { type : 'content' , value : '{ ' } ,
302+ {
303+ type : 'plural' ,
304+ arg : 'S' ,
305+ cases : [
306+ {
307+ key : 'other' ,
308+ tokens : [
309+ { type : 'octothorpe' } ,
310+ { type : 'content' , value : ' is a #' }
311+ ]
312+ }
313+ ]
314+ } ,
315+ { type : 'content' , value : ' }' }
316+ ] ) ;
300317 } ) ;
301318
302319 it ( 'should handle octothorpes with nested plurals' , ( ) => {
You can’t perform that action at this time.
0 commit comments