Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(jqLite): better support for xhtml
Browse files Browse the repository at this point in the history
it turns out that some stuff doesn't work in xhtml as it does in html.

for example   can't be innerHTML-ed and auto-closing of elements
doesn't work.

the reporter of the referenced issue claimed that innerHTML vs text on
script made a difference but that doesn't appear to be true in my testing.

I'm not including test for this because testacular doesn't currently
run tests in xhtml yet.

Closes #1301
  • Loading branch information
IgorMinar committed Aug 30, 2012
1 parent 8693eac commit d3fa7a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jqLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function JQLite(element) {
var div = document.createElement('div');
// Read about the NoScope elements here:
// http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
div.innerHTML = '<div>&nbsp;</div>' + element; // IE insanity to make NoScope elements work!
div.innerHTML = '<div>&#160;</div>' + element; // IE insanity to make NoScope elements work!
div.removeChild(div.firstChild); // remove the superfluous div
JQLiteAddNodes(this, div.childNodes);
this.remove(); // detach the elements from the temporary DOM div.
Expand Down
2 changes: 1 addition & 1 deletion src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function $CompileProvider($provide) {
// not be able to attach scope data to them, so we will wrap them in <span>
forEach($compileNode, function(node, index){
if (node.nodeType == 3 /* text node */) {
$compileNode[index] = jqLite(node).wrap('<span>').parent()[0];
$compileNode[index] = jqLite(node).wrap('<span></span>').parent()[0];
}
});
var compositeLinkFn = compileNodes($compileNode, transcludeFn, $compileNode, maxPriority);
Expand Down

0 comments on commit d3fa7a2

Please sign in to comment.