Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6785 closed defect (fixed)

FF: Whitespace stripping in RichText too slow

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.2
Component: Editor Version: 1.1.0
Keywords: Cc: liucougar
Blocked By: Blocking:

Description (last modified by Adam Peller)

The following line in RichText?.js takes many seconds to process a single buffer with non-breakable space in it.

		if(!ec.replace(/^(?:\s|\xA0)+/g, "").replace(/(?:\s|\xA0)+$/g,"").length){ ec = ""; }

Thanks to [email protected]… for narrowing this down. Pasting the following example into test_Editor.html (then put the focus outside of the editor to trigger) takes roughly 16 seconds to process this single line of code! The trick is, I think it has to have non-breaking spaces (\xa0) and trac converts them all to space... not sure how to post reproducible data here.

<p>Get started by clicking a button above.</p>                  
<li>Add an entry to this activity - you can attach files & bookmarks to entries.</li>                      
<li>Share this activity by clicking Add Members on the left-hand side.</li>                       
<li>Add a section to organize to-do items and entries.</li>                   
<br/> <p><a href="#">Learn more</a>&nbsp;&nbsp;    |   &nbsp;&nbsp;<a href="#">Watch demo</a></p>

Change History (3)

comment:1 Changed 14 years ago by Adam Peller

Cc: liucougar added

comment:2 Changed 14 years ago by Adam Peller

Resolution: fixed
Status: newclosed

fixed in [13766]

comment:3 Changed 14 years ago by Adam Peller

Description: modified (diff)
Note: See TracTickets for help on using tickets.