\n chars are also shown as  in the console.
Created attachment 77428 [details] [diff] [review] patch version 2
Comment on attachment 77428 [details] [diff] [review] patch version 2 >+ // get rid of newlines and tabs >+ var sourcetext= aObject.sourceLine; space before the = >+ sourcetext = sourcetext.replace(/[\n|\r]/g, ""); >+ sourcetext = sourcetext.replace(/^\t*/g, " "); >+ sourcetext = sourcetext.replace(/\t/g, " "); I'd make it do this instead: + sourcetext = sourcetext.replace(/\t/g, " "); + sourcetext = sourcetext.replace(/^\s*/, ""); and then change mozilla/xpfe/components/console/resources/content/console.css so that the rule for .console-error-source has a margin-left to accomplish the indentation then it'll be r=db48x
Created attachment 77434 [details] [diff] [review] better patch. now using a style
alecf: could you sr?
Erm... if you fiddle about with tabs like that you'll kill the error marker :-( Why not row.setAttribute("code", aObject.sourceLine.replace(/[\x00-\x1F]/g, " ")); [Aside: what was a dynamic regexp doing there?]
let me know when this is sorted out. I'm not sure I agree with the replacement of all characters < 0x1F though. I don't know what tabs should be. I was going to suggest 8 spaces, myself :)
the error marker isn't usually correct anyway, as both the code and the marker are shown in a varible width font, so even if we know what character the error was on, we can't line it up right. I say go ahead and check this patch in, and file the marker misalignment as a seperate bug. (I'd also change it to display an <hr/> or just a border instead of a bunch of dashes, so it would look prettier. That and the marker should probably be indented the same was as the code so that it has a better chance of lining up correctly.)
Actually the marker works fine in Classic, there's already a bug filed on that.
Created attachment 229232 [details] [diff] [review] replace all whitespace characters with spaces This patch simply replaces all whitespace characters which should prevent most of these irritating/useless squares (haven't seen any of them for over a year). The reason to replace every character with precisely one space is that otherwise the column marker will point to the wrong location since the column count is in plain characters.
mozilla/toolkit/components/console/content/consoleBindings.xml 1.17 mozilla/xpfe/components/console/resources/content/consoleBindings.xml 1.29