Closed Bug 880282 Opened 11 years ago Closed 9 years ago

Replace |FILTER no_break| by |class="nowrap"| to prevent dashes (U+002D) from being replaced by non-breaking hyphens/dashes (U+2011)

Categories

(Bugzilla :: Bugzilla-General, defect)

4.2.5
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: adaptee, Assigned: LpSolit)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0 (Beta/Release)
Build ID: 20130517114746

Steps to reproduce:

1. Visit https://bugs.kde.org/describecomponents.cgi 
2. press "Ctrl+F", try to search "wicd-client-kde" ( which is near the bottom of the products list)




Actual results:

No match



Expected results:

find it.
So the link corrspoding to "wicd-client-kde" product in that sample page is :

<a href="describecomponents.cgi?product=wicd-client-kde">wicd&#8209;client&#8209;kde</a>

some unicode magic here. Well, on the other hand, in editversions.cgi, the link is :

 <a href="editversions.cgi?product=wicd-client-kde">wicd-client-kde
</a>

I would suggest making them consistenly right (or wrong). Better than the current situation, IMO.
Hmm, using non-blocking hyphens in product names WFM when I tested at https://landfill.bugzilla.org/bugzilla-4.2-branch/describecomponents.cgi so this might be a local problem.

Actually, for the KDE page my browser (Chrome) can't even show those hyphens correctly in the normal web page (that's why the search doesn't work) but instead shows unknown character symbol. They seem to have heavily modified the look of the page so this might indeed be due to some local customization. Have you raised this issue with KDE Bugzilla admins?
They seem to define font as "Open Sans Light", "Helvetica Neue", Helvetica, Arial, sans-serif so maybe the first two are not Unicode-cabable?
Bug 776905 seems to support my verdict that there are non-Unicode capable "Open Sans Light" fonts out there. Feel free to open if you can reproduce on landfill install using standard template.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
I can reproduce upstream. - is replaced by &#8209; as we use FILTER no_break:

            # Prevents line break on hyphens and whitespaces.
            no_break => sub {
                my ($var) = @_;
                $var =~ s/ /\&nbsp;/g;
                $var =~ s/-/\&#8209;/g;
                return $var;
            },
Severity: normal → minor
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: WORKSFORME → ---
Summary: In describecomponents.cgi, can't find products whose name contain '-' by using the web browser search function (Ctrl+F) → In describecomponents.cgi & enter_bug.cgi, can't find products via browser search function as non-breaking hyphen/dash (U+2011) is used instead of U+002D
Hi,

I'm coming here from the Gnome bugzilla bug that André just linked to.

The current implementation of no_break causes problem when using the browser's search function (searching for a normal dash using the keyboard won't match), and causes problems if the content is copy-pasted (again, it becomes Unicode non-breaking hyphen rather than the original character).

Moreover, browsers break at many more characters, not just space and hyphen. The current implementation doesn't prevent breaking e.g. before a slash '/' character.

The correct implementation would leave the text intact, and apply some html (<nobr>) or CSS (white-space: nowrap).
(I haven't digged into the code; where is the implementation of no_break? Is it inside bugzilla, or inside some other component that bugzilla uses? In the latter case we should forward the bug to them.)
Attached patch patch, v1Splinter Review
Replace |FILTER no_break| by the existing 'nowrap' CSS class. Some places were already using this class and so |FILTER no_break| was useless.
Assignee: general → LpSolit
Status: REOPENED → ASSIGNED
Attachment #8574331 - Flags: review?(dkl)
Target Milestone: --- → Bugzilla 5.0
Summary: In describecomponents.cgi & enter_bug.cgi, can't find products via browser search function as non-breaking hyphen/dash (U+2011) is used instead of U+002D → Replace |FILTER no_break| by |class="nowrap"| to prevent dashes (U+002D) from being replaced by non-breaking hyphens/dashes (U+2011)
Comment on attachment 8574331 [details] [diff] [review]
patch, v1

Review of attachment 8574331 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8574331 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval5.0?
Flags: approval?
Flags: approval5.0?
Flags: approval5.0+
Flags: approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   e7526ca..17d05cc  master -> master

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   91e0780..c26e64e  5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Closed: 11 years ago9 years ago
Resolution: --- → FIXED
Thanks guys! :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: