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
df6e02a4
Commit
df6e02a4
authored
Nov 30, 2009
by
jeresig
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:jquery/jquery
parents
90ba57ce
17955cac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
core.js
src/core.js
+1
-1
core.js
test/unit/core.js
+11
-0
No files found.
src/core.js
View file @
df6e02a4
...
@@ -29,7 +29,7 @@ var jQuery = function( selector, context ) {
...
@@ -29,7 +29,7 @@ var jQuery = function( selector, context ) {
rnotwhite
=
/
\S
/
,
rnotwhite
=
/
\S
/
,
// Used for trimming whitespace
// Used for trimming whitespace
rtrim
=
/
^
\s
+|
\s
+$/g
,
rtrim
=
/
(\s
|
\u
00A0
)
+|
(\s
|
\u
00A0
)
+$/g
,
// Match a standalone tag
// Match a standalone tag
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>
)?
$/
,
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>
)?
$/
,
...
...
test/unit/core.js
View file @
df6e02a4
...
@@ -189,6 +189,17 @@ test("noConflict", function() {
...
@@ -189,6 +189,17 @@ test("noConflict", function() {
jQuery
=
$$
;
jQuery
=
$$
;
});
});
test
(
"trim"
,
function
()
{
expect
(
4
);
var
nbsp
=
String
.
fromCharCode
(
160
);
equals
(
jQuery
.
trim
(
"hello "
),
"hello"
,
"trailing space"
);
equals
(
jQuery
.
trim
(
" hello"
),
"hello"
,
"leading space"
);
equals
(
jQuery
.
trim
(
" hello "
),
"hello"
,
"space on both sides"
);
equals
(
jQuery
.
trim
(
" "
+
nbsp
+
"hello "
+
nbsp
+
" "
),
"hello"
,
" "
);
});
test
(
"isFunction"
,
function
()
{
test
(
"isFunction"
,
function
()
{
expect
(
19
);
expect
(
19
);
...
...
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