File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -341,20 +341,21 @@ window.WarningSingleton = window.WarningSingleton || (function () {
341341 * Wraps system names text to fit within a specified maximum line length.
342342 *
343343 * @param text - The text to wrap, typically a comma-separated list of system names.
344- * @param maxLineLength - The maximum length of each line before wrapping occurs.
345344 * @returns {string } - The wrapped text, with each line not exceeding the specified maximum length.
346345 */
347- function wrapSystemNamesText ( text , maxLineLength = 100 ) {
346+ function wrapSystemNamesText ( text ) {
348347 const parts = text . split ( ', ' ) ;
349348 const lines = [ ] ;
350349 let currentLine = '' ;
351350
352- for ( let i = 0 ; i < parts . length ; i ++ ) {
353- const part = parts [ i ] ;
354- const segment = currentLine ? `, ${ part } ` : part ;
351+ const isFirefox = typeof browser !== 'undefined' ;
352+ let maxLineLength = isFirefox ? 110 : 100 ;
355353
356- if ( ( currentLine + segment ) . length <= maxLineLength ) {
357- currentLine += segment ;
354+ for ( const part of parts ) {
355+ const nextSegment = currentLine ? `${ currentLine } , ${ part } ` : part ;
356+
357+ if ( nextSegment . length <= maxLineLength ) {
358+ currentLine = nextSegment ;
358359 } else {
359360 if ( currentLine ) {
360361 lines . push ( currentLine ) ;
You can’t perform that action at this time.
0 commit comments