Author: brian
Description:
If
I
reply to this comment, I will get:
Ifyoureply to this comment...
Version: unspecified
Severity: trivial
OS: Windows XP
Platform: PC
Author: brian
Description:
If
I
reply to this comment, I will get:
Ifyoureply to this comment...
Version: unspecified
Severity: trivial
OS: Windows XP
Platform: PC
brian wrote:
The second line should of course be:
IfIreply to this comment...
The important point is I just checked it and the bug is
there.
rowan.collins wrote:
Hm, my first thought was that like so many bugs in "MediaZilla", it's probably
actually a bug in bugzilla itself (http://bugzilla.org). Secondly, it works fine
in Mozilla, and only breaks in IE - perhaps not surprising given that this bug
tracker was created to serve the needs of Mozilla developers :)
But now I try it out, using IE, on http://bugzilla.mozilla.org, I can't
reproduce the error (whereas I can on this site). I don't think it's just a
different version, because the JavaScript functions seem to be the same...
Ah, got it - the comments here are in a <div> with a <br /> at the end of each
line, whereas on b.m.o they're in a <pre>, so the <br />s aren't needed.
Clearly, this is breaking the JavaScript line-splitting routine under IE, which
happens here (look in the source for this page):
/* make sure we split on all newlines -- IE or Moz use \r and \n * respectively */ text = text.split(/\r|\n/);
Not sure how to get round that; maybe need to explicitly watch for <br /> tags
in the getText() function and add a "\r"?
brian wrote:
An "\r" or an "\n"?
I notice that your comment is rendered using:
<div class='comment' id="comment_text_2">Hm, my first
thought was that like so many bugs in
"MediaZilla", it's probably<br />
actually...
So why is there a line break after the word "probably"?
rowan.collins wrote:
(In reply to comment #3)
An "\r" or an "\n"?
Well, actually it doesn't matter, because it's only got to be spotted by the
"split" regex I quoted - it can just be a placeholder string if we like.
So why is there a line break after the word "probably"?
Because that's where the newline gets output in the source (next to the <br> tag
which does the hard-wrapping). In fact, via some red herrings I won't bore you
with, testing confirms that Mozilla sees "\n"s whereever there's a new line in
the source code, while IE sees them *only* inside a <pre> section.
So all that's needed to make an alternative function for sites using <br>s is an
extra part in getText() like:
} else if (child.tagName == "BR") {
text += "BR_PLACEHOLDER";
} else ...
and to replace "text.split(\r|\n);" with
text = text.replace(/\n|\r/g, ""); text = text.split(/BR_PLACEHOLDER/);
In other words, ignore the newlines completely, and split on <br>s instead.
Of course, that's no good if the comments *are* in <pre>s, so will *only* work
here, but it does behave the same in both IE and Moz. (It might also make sense
to build the array as we go, rather than inserting and splitting on a magic
string, but I can't be bothered to work out how.)
brian wrote:
So why is there a line break after the
word "probably"?
Because that's where the newline gets output in the
source (next to the <br> tag
which does the hard-wrapping).
Why was there a <br> tag output at that point?
rowan.collins wrote:
(In reply to comment #5)
Why was there a <br> tag output at that point?
Because that's where Bugzilla decided to hard-wrap my comment, roughly at the
fairly standard width of 80 columns. Your comments appear to be being wrapped
much more tightly - perhaps IE is hard-wrapping them to your window size?
bugzilla.mozilla.org
(Note that 2.20 is out and has significant changes to wrapping. We haven't
upgraded yet as I encountered some serious problems during the upgrade.)
brian wrote:
It can't be that IE is wrapping them to my window size
because the "br" tag was output by the server and the
server doesn't know my window size.
gangleri wrote:
Note from "LpSolit" from bugzilla.mozilla.org:
Ask them to try to reproduce the problem on our landfill installation:
http://landfill.bugzilla.org/bugzilla-tip/
If they can, ask them to open a bug on bugzilla.mozilla.org. Else it's either
an invalid bug or a mistake in wikimedia customisation.
LpSolit
gangleri wrote:
(In reply to comment #10)
That site doesn't work for me.
http://landfill.bugzilla.org/bugzilla-tip/ is a bugzilla test installtion using
version Bugzilla Version 2.21.1+
You may log in and make whatever tests you like. For help please join
irc://irc.mozilla.org/mozwebtools .
best regards reinhardt [[user:gangleri]]
brian wrote:
It's working now - it came up with a wierd message
before. Also, "Note from "LpSolit" from
bugzilla.mozilla.org:" - I can't find where the
following comment comes from.
gangleri wrote:
see http://landfill.bugzilla.org/bugzilla-tip/show_bug.cgi?id=3202
It seems that this is fixed in Bugzilla Version 2.21.1+
best regards reinhardt [[user:gangleri]]
P.S. The "Note from "LpSolit" was from IRC ( irc://irc.mozilla.org/mozwebtools )