partially hidden comment in bug report

Bug #504956 reported by Jean-Baptiste Lallement
56
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Launchpad Greasemonkey Scripts
Fix Released
High
Rune Philosof

Bug Description

I've added a comment #3 in bug 504500 and part of the comment is not displayed.
The full link is https://bugs.edge.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/504500/comments/3
The page source shows the complete comment but <wbr></wbr> tags are inserted and it seems that it triggers the display bug.

The comment has been written manually and the version number copied/pasted from the Dependencies.txt attached to the report.
The emails I received contains the full comment and the <wbr> tags are not there.

I I'm unable to reproduce it on staging.

Browser : Firefox 3.5.7+nobinonly-0ubuntu1 with greasemonkey / launchpad enhancement enabled then disabled.

Let me know if you need more infos.

Related branches

Revision history for this message
Curtis Hovey (sinzui) wrote :

The <wbr> are inserted by the launchpad page formatter to make long lines wrap. I cannot see a problems with the message in Firefox or Epiphany when I compare the display with the message source. What part of the message is not showing?

affects: launchpad → malone
Changed in malone:
status: New → Incomplete
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

After further testings it appears to be a bug in firefox-lp-improvements. Affecting to launchpad-gm-scripts .

affects: malone → launchpad-gm-scripts
Changed in launchpad-gm-scripts:
status: Incomplete → New
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

The upper shot shows the rendering with lp_improvement disabled and the bottom one with latest lp_improvements enabled.

apt-cache policy firefox-lp-improvements
firefox-lp-improvements:
  Installed: 0.94-0ubuntu1~ppa1
  Candidate: 0.94-0ubuntu1~ppa1
  Version table:
 *** 0.94-0ubuntu1~ppa1 0

Revision history for this message
Brian Murray (brian-murray) wrote :

It LP_HighlightWords causing the particular issue you are seeing. You could just disable that part of firefox-lp-improvements as a temporary solution.

Revision history for this message
Philip Muškovac (yofel) wrote :

I'll confirm this as I get the same bug with the highlighting plugin enabled.
In bug 499602 it even cuts out the whole apport information in the description exept 'DistroRelease: Ubuntu 10.04'

Changed in launchpad-gm-scripts:
status: New → Confirmed
Revision history for this message
Draycen DeCator (ddecator) wrote :

Also affects Firefox 3.7 with firefox-lp-improvements. I can add screenshots, however everyone already seems to know what this bug looks like.

Revision history for this message
Philip Muškovac (yofel) wrote :

From duplicate bug 565319:

This happens because word highlighter works by replacing the innerHTML of the parent to the found text, thus removing all siblings to the selected text node.
                    text.snapshotItem(i).parentNode.innerHTML = text.snapshotItem(i).textContent.replace(regex,'<span name=' + rid + ' id=' + rid + ' style=\'color:#000;background-color:'+ color_map[key] +';\'>$1</span>');

Revision history for this message
Rune Philosof (olberd) wrote :

The easiest way to fix this would be to select //div[class='bug-comment'] and then run the regexp-replace on the innerhtml of those div elements.

Of course that would not be as generic an approach as the present one.

Another way, to keep the generic property would be to run the regexp on the parent innerhtml and then either accept that the same parents can be searched a lot of times or a keep track of which parents have already been searched.

Revision history for this message
Rune Philosof (olberd) wrote :
Changed in launchpad-gm-scripts:
status: Confirmed → In Progress
assignee: nobody → Rune Philosof (olberd)
Revision history for this message
Brian Murray (brian-murray) wrote :

Rune - Thanks for the patch! I'm really excited to see word highlighting working properly. Unfortunately, it appears to be causing some conflicts with other greasemonkey scripts. For example, when enabling both lp_karma_suffix and lp_highlight_words only lp_highlight_words works. As an example with this bug report you will not seen anyone's karma nor badges near my name. Do you have any idea what is going on?

Oh also the "Post Comment" button at the bottom of the bug report page was unusable which was interesting!

Revision history for this message
Brian Murray (brian-murray) wrote :

I don't think using //div[class='bug-comment'] would catch the bug description which is one of the issues I was running into when originally writing this script.

Revision history for this message
Kees Cook (kees) wrote :

I think any use of innerHTML will cause problems. If the text node could be split into three node (before, the word, and after), then the span could be added using regular insertBefore()-style functions that would hopefully not get in the way of other scripts.

Revision history for this message
Rune Philosof (olberd) wrote :

I agree with #12.
It was a silly way I implemented the change. Actually only works for the first color.
And apparently other stuff can be broken by me adding an attribute to each and every element with a text node.
I am working on the splitting.

Revision history for this message
Brian Murray (brian-murray) wrote :

This is looking great thanks again for continuing to work on this. However, when testing this I did discover one unfortunate situation. As an example if you look at bug 567831 you'll notice that 'lucid' is highlighted in the bug tags which is fine I think. But when you go to edit the bug tags you'll notice that the span is included around the lucid tag. I've haven't tried submitting the tag like that but I imagine it wouldn't work out well.

Is there some way we could exclude the bug-tags div altogether in your xpath statement? I think that would be a fine a compromise as I'd be really surprised to find a bug with lucid as a tag and not in the description!

Revision history for this message
Rune Philosof (olberd) wrote :

Naturally..
As you can see in the commit text I had actually intended for the tags to be excluded.

Revision history for this message
Brian Murray (brian-murray) wrote :

The fix is in the bzr branch for launchpad-gm-scripts so one could grab it there if they want. I'll work on updating the PPA as soon as possible but I'd like to get the fix for bug 564978 included in the PPA too.

Changed in launchpad-gm-scripts:
status: In Progress → Fix Committed
importance: Undecided → High
Revision history for this message
Brian Murray (brian-murray) wrote :

I released a new version of the PPA package that includes this fix. Thanks again!

Changed in launchpad-gm-scripts:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.