Trim expressions before displaying them in Console messages
Categories
(DevTools :: Console, enhancement, P3)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: fvsch, Assigned: fvsch)
Details
Attachments
(2 files, 1 obsolete file)
Expressions like \n\n\nfoo\n\n\n
are displayed in messages with all the line breaks intact, which creates big gaps in the console output.
This can be an issue with the new Editor mode, which makes it easier and more likely for users to have one or several start or end line breaks.
We should probably trim the expression before rendering it in messages.
Comment 1•5 years ago
|
||
Thanks for filing this issue Florens!
I agree we should trim before adding the message in the output
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Tried a quick patch. I trims whitespace at the start and end, but also:
- removes trailing whitespace for each line
- keeps only 1 blank line
This is not quite Prettier, but the result seems nice.
Maybe the trailing whitespace and/or maxlines part are too opinionated. What do you think?
Comment 4•5 years ago
|
||
:fvsch, this looks good and seems lax enough to work make bad cases render in a space-saving way.
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D39316
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/46b354546ad8 Trim input text in Console messages; r=nchevobbe
Comment 7•5 years ago
|
||
bugherder |
Description
•