git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #1257 from tarleb/mathmlinhtml-deprecation-warning
bf0c725John MacFarlane
data/MathMLinHTML.js+10−10
@@ -1,4 +1,4 @@
1−/*
1+/*
2March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
2March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
3Released under the GNU General Public License version 2 or later.
3Released under the GNU General Public License version 2 or later.
4See the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)
4See the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)
@@ -7,15 +7,15 @@ for more details.
7
7
8function convertMath(node) {// for Gecko
8function convertMath(node) {// for Gecko
9 if (node.nodeType==1) {
9 if (node.nodeType==1) {
10− var newnode =
10+ var newnode =
11 document.createElementNS("http://www.w3.org/1998/Math/MathML",
11 document.createElementNS("http://www.w3.org/1998/Math/MathML",
12 node.nodeName.toLowerCase());
12 node.nodeName.toLowerCase());
13 for(var i=0; i < node.attributes.length; i++)
13 for(var i=0; i < node.attributes.length; i++)
14 newnode.setAttribute(node.attributes[i].nodeName,
14 newnode.setAttribute(node.attributes[i].nodeName,
15− node.attributes[i].nodeValue);
15+ node.attributes[i].value);
16 for (var i=0; i<node.childNodes.length; i++) {
16 for (var i=0; i<node.childNodes.length; i++) {
17 var st = node.childNodes[i].nodeValue;
17 var st = node.childNodes[i].nodeValue;
18− if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")
18+ if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")
19 newnode.appendChild(convertMath(node.childNodes[i]));
19 newnode.appendChild(convertMath(node.childNodes[i]));
20 }
20 }
21 return newnode;
21 return newnode;
@@ -37,14 +37,14 @@ function convert() {
37 if (st=="#text") str += node.nodeValue;
37 if (st=="#text") str += node.nodeValue;
38 else {
38 else {
39 str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);
39 str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);
40− if (st.slice(0,1)!="/")
40+ if (st.slice(0,1)!="/")
41 for(var j=0; j < node.attributes.length; j++)
41 for(var j=0; j < node.attributes.length; j++)
42− if (node.attributes[j].nodeValue!="italic" &&
42+ if (node.attributes[j].value!="italic" &&
43− node.attributes[j].nodeValue!="" &&
43+ node.attributes[j].value!="" &&
44− node.attributes[j].nodeValue!="inherit" &&
44+ node.attributes[j].value!="inherit" &&
45− node.attributes[j].nodeValue!=undefined)
45+ node.attributes[j].value!=undefined)
46 str += " "+node.attributes[j].nodeName+"="+
46 str += " "+node.attributes[j].nodeName+"="+
47− "\""+node.attributes[j].nodeValue+"\"";
47+ "\""+node.attributes[j].value+"\"";
48 str += ">";
48 str += ">";
49 }
49 }
50 node = node.nextSibling;
50 node = node.nextSibling;