Skip to content
Permalink
Browse files

Make sure that &#...; entities are encoded properly. Fixes #6042.

  • Loading branch information
jeresig committed Feb 6, 2010
1 parent 54bd004 commit d74389997106b02cf513f573a0d7197ecc511514
Showing with 5 additions and 2 deletions.
  1. +1 −1 src/manipulation.js
  2. +4 −1 test/unit/manipulation.js
@@ -4,7 +4,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&\w+;/,
rhtml = /<|&#?\w+;/,
rnocache = /<script|<object|<embed/i,
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5)
fcloseTag = function( all, front, tag ) {
@@ -851,7 +851,7 @@ test("clone() on XML nodes", function() {
}

var testHtml = function(valueObj) {
expect(24);
expect(26);

jQuery.scriptorder = 0;

@@ -868,6 +868,9 @@ var testHtml = function(valueObj) {
equals( div.children().length, 2, "Make sure two child nodes exist." );
equals( div.children().children().length, 1, "Make sure that a grandchild exists." );

equals( jQuery("<div/>").html(valueObj("&#160;"))[0].innerHTML, "&nbsp;", "Make sure entities are passed through correctly." );
equals( jQuery("<div/>").html(valueObj("&amp;"))[0].innerHTML, "&amp;", "Make sure entities are passed through correctly." );

reset();
// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();

1 comment on commit d743899

@jeresig

This comment has been minimized.

Copy link
Member Author

jeresig commented on d743899 Feb 6, 2010

Oops, meant #6011, not #6042.

Please sign in to comment.
You can’t perform that action at this time.