diff --git a/devtools/client/shared/components/reps/string.js b/devtools/client/shared/components/reps/string.js index beb15b127367..175c1cafa905 100644 --- a/devtools/client/shared/components/reps/string.js +++ b/devtools/client/shared/components/reps/string.js @@ -10,7 +10,7 @@ define(function (require, exports, module) { // Dependencies const React = require("devtools/client/shared/vendor/react"); - const { cropMultipleLines } = require("./rep-utils"); + const { cropString } = require("./rep-utils"); // Shortcuts const { span } = React.DOM; @@ -43,13 +43,14 @@ define(function (require, exports, module) { } let croppedString = this.props.cropLimit ? - cropMultipleLines(text, this.props.cropLimit) : cropMultipleLines(text); + cropString(text, this.props.cropLimit) : cropString(text); let formattedString = this.props.useQuotes ? "\"" + croppedString + "\"" : croppedString; return ( - span({className: "objectBox objectBox-string"}, formattedString + span({className: "objectBox objectBox-string"}, + formattedString ) ); }, diff --git a/devtools/client/shared/components/test/mochitest/test_reps_string.html b/devtools/client/shared/components/test/mochitest/test_reps_string.html index 4560c83aa438..19430f9eabd6 100644 --- a/devtools/client/shared/components/test/mochitest/test_reps_string.html +++ b/devtools/client/shared/components/test/mochitest/test_reps_string.html @@ -36,12 +36,12 @@ window.onload = Task.async(function* () { function testMultiline() { const renderedComponent = renderComponent(StringRep.rep, { object: getGripStub("testMultiline") }); - is(renderedComponent.textContent, "\"aaaaaaaaaaaaaaaaaaaaa\\nbbbbbbbbbbbbbbbbbbb\\ncccccccccccccccc\\n\"", "String rep has expected text content for multiline string"); + is(renderedComponent.textContent, "\"aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n\"", "String rep has expected text content for multiline string"); } function testMultilineLimit() { const renderedComponent = renderComponent(StringRep.rep, { object: getGripStub("testMultiline"), cropLimit: 20 }); - is(renderedComponent.textContent, "\"aaaaaaaaaa…cccccccc\\n\"", "String rep has expected text content for multiline string with specified number of characters"); + is(renderedComponent.textContent, "\"aaaaaaaaaa…cccccccc\n\"", "String rep has expected text content for multiline string with specified number of characters"); } function testMultilineOpen() {