From 9d43aa42b128d9235d4d2f57d5eb9cee960715be Mon Sep 17 00:00:00 2001 From: erikn69 Date: Thu, 20 Feb 2025 14:17:09 -0500 Subject: [PATCH] Avoid LF, \t, multiple spaces on timeline (#735) --- src/DebugBar/Resources/widgets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DebugBar/Resources/widgets.js b/src/DebugBar/Resources/widgets.js index 33791b3..b3f94f0 100644 --- a/src/DebugBar/Resources/widgets.js +++ b/src/DebugBar/Resources/widgets.js @@ -526,7 +526,7 @@ if (typeof(PhpDebugBar) == 'undefined') { width: width + "%" })); m.append($('').addClass(csscls('label')) - .text(measure.label + ( measure.duration ? " (" + measure.duration_str +(measure.memory ? '/' + measure.memory_str: '') + ")" : ""))); + .text(measure.label.replace(/\s+/g, ' ') + ( measure.duration ? " (" + measure.duration_str +(measure.memory ? '/' + measure.memory_str: '') + ")" : ""))); if (measure.collector) { $('').addClass(csscls('collector')).text(measure.collector).appendTo(m); @@ -573,7 +573,7 @@ if (typeof(PhpDebugBar) == 'undefined') { width = Math.min((aggregate.data.duration * 100 / data.duration).toFixed(2), 100); aggregateTable.append('' + - aggregate.data.count + ' x ' + $('').text(aggregate.label).html() + ' (' + width + '%)' + + aggregate.data.count + ' x ' + $('').text(aggregate.label.replace(/\s+/g, ' ')).html() + ' (' + width + '%)' + '
' + '' + '' + formatDuration(aggregate.data.duration) + (aggregate.data.memory ? '/' + formatBytes(aggregate.data.memory) : '') + '' +