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

Commit d3fa7a2

Browse files
committed
fix(jqLite): better support for xhtml
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
1 parent 8693eac commit d3fa7a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/jqLite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function JQLite(element) {
165165
var div = document.createElement('div');
166166
// Read about the NoScope elements here:
167167
// http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
168-
div.innerHTML = '<div>&nbsp;</div>' + element; // IE insanity to make NoScope elements work!
168+
div.innerHTML = '<div>&#160;</div>' + element; // IE insanity to make NoScope elements work!
169169
div.removeChild(div.firstChild); // remove the superfluous div
170170
JQLiteAddNodes(this, div.childNodes);
171171
this.remove(); // detach the elements from the temporary DOM div.

src/ng/compile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ function $CompileProvider($provide) {
319319
// not be able to attach scope data to them, so we will wrap them in <span>
320320
forEach($compileNode, function(node, index){
321321
if (node.nodeType == 3 /* text node */) {
322-
$compileNode[index] = jqLite(node).wrap('<span>').parent()[0];
322+
$compileNode[index] = jqLite(node).wrap('<span></span>').parent()[0];
323323
}
324324
});
325325
var compositeLinkFn = compileNodes($compileNode, transcludeFn, $compileNode, maxPriority);

0 commit comments

Comments
 (0)