Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
00eafdf0
Commit
00eafdf0
authored
May 09, 2013
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13223. Re-allow leading space in HTML. Close gh-1264.
parent
0135a223
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
14 deletions
+8
-14
core.js
src/core.js
+1
-1
core.js
test/unit/core.js
+7
-1
selector.js
test/unit/selector.js
+0
-12
No files found.
src/core.js
View file @
00eafdf0
...
@@ -55,7 +55,7 @@ var
...
@@ -55,7 +55,7 @@ var
// A simple way to check for HTML strings
// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
// Strict HTML recognition (#11290: must start with <)
rquickExpr
=
/^
(?:(
<
[\w\W]
+>
)[^
>
]
*|#
([\w
-
]
*
))
$/
,
rquickExpr
=
/^
(?:
\s
*
(
<
[\w\W]
+>
)[^
>
]
*|#
([\w
-
]
*
))
$/
,
// Match a standalone tag
// Match a standalone tag
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>|
)
$/
,
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>|
)
$/
,
...
...
test/unit/core.js
View file @
00eafdf0
...
@@ -33,7 +33,7 @@ test("jQuery()", function() {
...
@@ -33,7 +33,7 @@ test("jQuery()", function() {
div
=
jQuery
(
"<div/><hr/><code/><b/>"
),
div
=
jQuery
(
"<div/><hr/><code/><b/>"
),
exec
=
false
,
exec
=
false
,
lng
=
""
,
lng
=
""
,
expected
=
2
0
,
expected
=
2
2
,
attrObj
=
{
attrObj
=
{
"text"
:
"test"
,
"text"
:
"test"
,
"class"
:
"test2"
,
"class"
:
"test2"
,
...
@@ -108,6 +108,12 @@ test("jQuery()", function() {
...
@@ -108,6 +108,12 @@ test("jQuery()", function() {
equal
(
jQuery
(
document
.
body
).
get
(
0
),
jQuery
(
"body"
).
get
(
0
),
"Test passing an html node to the factory"
);
equal
(
jQuery
(
document
.
body
).
get
(
0
),
jQuery
(
"body"
).
get
(
0
),
"Test passing an html node to the factory"
);
elem
=
jQuery
(
" <em>hello</em>"
)[
0
];
equal
(
elem
.
nodeName
.
toLowerCase
(),
"em"
,
"leading space"
);
elem
=
jQuery
(
"
\n\n
<em>world</em>"
)[
0
];
equal
(
elem
.
nodeName
.
toLowerCase
(),
"em"
,
"leading newlines"
);
elem
=
jQuery
(
"<div/>"
,
attrObj
);
elem
=
jQuery
(
"<div/>"
,
attrObj
);
if
(
jQuery
.
fn
.
width
)
{
if
(
jQuery
.
fn
.
width
)
{
...
...
test/unit/selector.js
View file @
00eafdf0
...
@@ -73,18 +73,6 @@ test("disconnected nodes - jQuery only", function() {
...
@@ -73,18 +73,6 @@ test("disconnected nodes - jQuery only", function() {
equal
(
$opt
.
is
(
":selected"
),
true
,
"selected option"
);
equal
(
$opt
.
is
(
":selected"
),
true
,
"selected option"
);
});
});
test
(
"jQuery only - broken"
,
1
,
function
()
{
raises
(
function
()
{
// Setting context to null here somehow avoids QUnit's window.error handling
// making the e & e.message correct
// For whatever reason, without this,
// Sizzle.error will be called but no error will be seen in oldIE
jQuery
.
call
(
null
,
" <div/> "
);
},
function
(
e
)
{
return
(
/syntax.err/i
).
test
(
e
.
message
);
},
"leading space invalid: $(' <div/> ')"
);
});
testIframe
(
"selector/html5_selector"
,
"attributes - jQuery.attr"
,
function
(
jQuery
,
window
,
document
)
{
testIframe
(
"selector/html5_selector"
,
"attributes - jQuery.attr"
,
function
(
jQuery
,
window
,
document
)
{
expect
(
35
);
expect
(
35
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment