Skip to main content

Bug Tracker

Side navigation

#855 closed bug (fixed)

Opened January 21, 2007 04:48PM UTC

Closed January 22, 2007 03:32AM UTC

Last modified June 19, 2007 09:24AM UTC

Newlines in $(html) crash Firefox

Reported by: jchaffer@gmail.com Owned by:
Priority: major Milestone: 1.1
Component: core Version: 1.1
Keywords: Cc:
Blocked by: Blocking:
Description

Probaby due to regular expression syntax, newlines present in an HTML string sent to the $() constructor will cause a browser hang. For example,

$('<div>test test</div>');

works fine, but

$('<div>test

test</div>');

kills the browser (Firefox 2.0.0.1 Mac).

If the newline is not allowed, a more graceful failure is needed. Something along the lines of:

html = html.replace(/[

]/g, ' ');

should be sufficient to allow newlines.

Attachments (0)
Change History (1)

Changed January 22, 2007 03:32AM UTC by john comment:1

milestone: → 1.1
resolution: → fixed
status: newclosed
version: 1.1a1.1

Fixed in SVN rev 1148.