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
bf4fce70
Commit
bf4fce70
authored
Jan 13, 2013
by
Oleg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #13200 - innerHTML in buildFragment need end tags
parent
e5f37953
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
manipulation.js
src/manipulation.js
+11
-10
No files found.
src/manipulation.js
View file @
bf4fce70
...
@@ -29,18 +29,18 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca
...
@@ -29,18 +29,18 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca
rscriptTypeMasked
=
/^true
\/(
.*
)
/
,
rscriptTypeMasked
=
/^true
\/(
.*
)
/
,
rcleanScript
=
/^
\s
*<!
(?:\[
CDATA
\[
|--
)
|
(?:\]\]
|--
)
>
\s
*$/g
,
rcleanScript
=
/^
\s
*<!
(?:\[
CDATA
\[
|--
)
|
(?:\]\]
|--
)
>
\s
*$/g
,
wrapMap
=
{
wrapMap
=
{
option
:
[
1
,
"<select multiple='multiple'>"
],
option
:
[
1
,
"<select multiple='multiple'>"
,
"</select>"
],
legend
:
[
1
,
"<fieldset>"
],
legend
:
[
1
,
"<fieldset>"
,
"</fieldset>"
],
area
:
[
1
,
"<map>"
],
area
:
[
1
,
"<map>"
,
"</map>"
],
param
:
[
1
,
"<object>"
],
param
:
[
1
,
"<object>"
,
"</object>"
],
thead
:
[
1
,
"<table>"
],
thead
:
[
1
,
"<table>"
,
"</table>"
],
tr
:
[
2
,
"<table><tbody>"
],
tr
:
[
2
,
"<table><tbody>"
,
"</tbody></table>"
],
col
:
[
2
,
"<table><tbody></tbody><colgroup>"
,
"</table>"
],
col
:
[
2
,
"<table><tbody></tbody><colgroup>"
,
"</
colgroup></
table>"
],
td
:
[
3
,
"<table><tbody><tr>"
],
td
:
[
3
,
"<table><tbody><tr>"
,
"</tr></tbody></table>"
],
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// unless wrapped in a div with non-breaking characters in front of it.
// unless wrapped in a div with non-breaking characters in front of it.
_default
:
jQuery
.
support
.
htmlSerialize
?
[
0
,
""
]
:
[
1
,
"X<
div>"
]
_default
:
jQuery
.
support
.
htmlSerialize
?
[
0
,
""
,
""
]
:
[
1
,
"X<div>"
,
"</
div>"
]
},
},
safeFragment
=
createSafeFragment
(
document
),
safeFragment
=
createSafeFragment
(
document
),
fragmentDiv
=
safeFragment
.
appendChild
(
document
.
createElement
(
"div"
)
);
fragmentDiv
=
safeFragment
.
appendChild
(
document
.
createElement
(
"div"
)
);
...
@@ -647,7 +647,8 @@ jQuery.extend({
...
@@ -647,7 +647,8 @@ jQuery.extend({
// Deserialize a standard representation
// Deserialize a standard representation
tag
=
(
rtagName
.
exec
(
elem
)
||
[
""
,
""
]
)[
1
].
toLowerCase
();
tag
=
(
rtagName
.
exec
(
elem
)
||
[
""
,
""
]
)[
1
].
toLowerCase
();
wrap
=
wrapMap
[
tag
]
||
wrapMap
.
_default
;
wrap
=
wrapMap
[
tag
]
||
wrapMap
.
_default
;
tmp
.
innerHTML
=
wrap
[
1
]
+
elem
.
replace
(
rxhtmlTag
,
"<$1></$2>"
)
+
(
wrap
[
2
]
||
""
);
tmp
.
innerHTML
=
wrap
[
1
]
+
elem
.
replace
(
rxhtmlTag
,
"<$1></$2>"
)
+
wrap
[
2
];
// Descend through wrappers to the right content
// Descend through wrappers to the right content
j
=
wrap
[
0
];
j
=
wrap
[
0
];
...
...
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