Self-closing tags in HTML aren't processed properly in some browser, and end up with the following elements as children. This patch moves the children back out to become siblings again.

This commit is contained in:
Davide P. Cervone 2011-01-19 20:24:16 -05:00
parent 5d513b383d
commit 699e063991
10 changed files with 24 additions and 17 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.0.3",directory:MathJax.InputJax.directory+"/MathML",extensionDir:MathJax.InputJax.extensionDir+"/MathML",entityDir:MathJax.InputJax.directory+"/MathML/entities",config:{useMathMLspacing:false}});MathJax.InputJax.MathML.Register("math/mml");MathJax.InputJax.MathML.loadComplete("config.js");
MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.0.4",directory:MathJax.InputJax.directory+"/MathML",extensionDir:MathJax.InputJax.extensionDir+"/MathML",entityDir:MathJax.InputJax.directory+"/MathML/entities",config:{useMathMLspacing:false}});MathJax.InputJax.MathML.Register("math/mml");MathJax.InputJax.MathML.loadComplete("config.js");

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@
MathJax.InputJax.MathML = MathJax.InputJax({
id: "MathML",
version: "1.0.3",
version: "1.0.4",
directory: MathJax.InputJax.directory + "/MathML",
extensionDir: MathJax.InputJax.extensionDir + "/MathML",
entityDir: MathJax.InputJax.directory + "/MathML/entities",

View File

@ -73,7 +73,7 @@
var child = node.childNodes[i];
if (child.nodeName === "#comment") continue;
if (child.nodeName === "#text") {
if (mml.isToken) {
if (mml.isToken && !mml.mmlSelfClosing) {
var text = this.trimSpace(child.nodeValue);
if (mml.isa(MML.mo) && text.length === 1 && this.Remap[text.charAt(0)])
{text = this.Remap[text.charAt(0)]}
@ -82,7 +82,11 @@
} else if (child.nodeValue.match(/\S/)) {
MATHML.Error("Unexpected text node: '"+child.nodeValue+"'");
}
} else {mml.Append(this.MakeMML(child))}
} else {
var cmml = this.MakeMML(child); mml.Append(cmml);
if (cmml.mmlSelfClosing && cmml.data.length)
{mml.Append.apply(mml,cmml.data); cmml.data = []}
}
}
if (MATHML.config.useMathMLspacing) {mml.useMMLspacing = 0x08}
return mml;
@ -161,6 +165,9 @@
//
Startup: function () {
MML = MathJax.ElementJax.mml;
MML.mspace.Augment({mmlSelfClosing: true});
MML.none.Augment({mmlSelfClosing: true});
MML.mprescripts.Augment({mmlSelfClossing:true});
if (window.DOMParser) {
this.parser = new DOMParser();
this.ParseXML = this.parseDOM;