File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,12 @@ export class LocalizedStringBuilder<T extends MergedLocalizerTokens> extends Str
352
352
}
353
353
354
354
private postProcessStrippedString ( str : string ) : string {
355
+ if ( typeof process . env . TEST_WORKER_INDEX === 'string' && process . env . TEST_WORKER_INDEX . length ) {
356
+ // Special case for when running in playwright (those files are reused for session-appium & session-playwright as is).
357
+ // When that's the case, we need to replace `<br/>` and `<br/><br/>` with a single space.
358
+ // " <br/><br/>" and "<br/>" both become a single space
359
+ return str . replace ( / \s * ( < b r \s * \/ ? > [ \s ] * ) + / gi, ' ' ) . replace ( / < [ ^ > ] * > / g, '' ) ;
360
+ }
355
361
const strippedString = str . replaceAll ( / < [ ^ > ] * > / g, '' ) ;
356
362
return deSanitizeHtmlTags ( strippedString , '\u200B' ) ;
357
363
}
You can’t perform that action at this time.
0 commit comments