Closed
Bug 926189
Opened 11 years ago
Closed 8 years ago
Variables View: String display mustn't strip special characters such as line breaks
Categories
(DevTools :: Object Inspector, defect)
DevTools
Object Inspector
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1258584
People
(Reporter: till, Unassigned)
Details
Somewhat similar to bug 868276, but while \t is at least displayed (as whitespace) when editing the string, \n and \r just get stripped completely.
For comparison, Chrome shows a character similar to "⏎" for \n and \r\n, (I guess) four spaces for \t, and strips \r.
Comment 1•11 years ago
|
||
Another option would be to just show whitespace characters (besides regular spaces) as their escaped representation e.g. "\n" for newline.
Reporter | ||
Comment 2•11 years ago
|
||
Would we then show the escaped versions with a leading "\\"? That'd work, I guess, and make them directly copyable as JS string literals.
Comment 3•11 years ago
|
||
Yeah I guess we'd also have to escape actual backslashes. This is what node.js's REPL does. It also escapes quotes as necessary, so every string is copy pastable as valid js code to make that string. `string.toSource()` does that for us here, so that would be a simple way to accomplish this.
Comment 4•11 years ago
|
||
Since toSource shows all primitives as objects (bug 879554) you have to do `string.toSource().slice(12, -2)`.
Comment 5•8 years ago
|
||
Closing this one as a dup since the other one has the start of a patch.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•