Closed
Bug 574516
Opened 14 years ago
Closed 14 years ago
Improve the highlighting algorithm to not add spans inside each other
Categories
(Tree Management Graveyard :: TBPL, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file)
1.43 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
philor pointed out to me that the new highlighting code on tbpl can inject nested <spans>. For example, let's say we have this in some phase of the algorithm: <span class="highlight">foo</span>, and the next token is "t". The result would be: <span class="highligh<span class="highlight">t</span>">foo</span> Not pretty. This patch changes that algorithm to take nesting into account for both tags and entities. The trick is the inTag function, which basically takes the part of the string preceding an index, and makes sure the number of start tokens (such as <) is not higher than the number of end tokens (such as >).
Attachment #453923 -
Flags: review?(mstange)
Comment 1•14 years ago
|
||
Comment on attachment 453923 [details] [diff] [review] Patch (v1) >+ return prePart.split(start).length > prePart.split(end).length; Very creative!
Attachment #453923 -
Flags: review?(mstange) → review+
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•14 years ago
|
||
(In reply to comment #1) > (From update of attachment 453923 [details] [diff] [review]) > >+ return prePart.split(start).length > prePart.split(end).length; > > Very creative! Yeah, I have my days! ;-) http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/rev/9a6588ffe785
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Product: Webtools → Tree Management
Updated•9 years ago
|
Product: Tree Management → Tree Management Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•