Allow preview to be just a plain string (rather than requiring [string]).
This commit is contained in:
parent
ef86d63009
commit
d2bbe75499
unpacked/extensions
|
@ -201,9 +201,8 @@ MathJax.Extension.asciimath2jax = {
|
|||
},
|
||||
|
||||
createPreview: function (mode,asciimath) {
|
||||
var preview;
|
||||
if (this.config.preview === "AsciiMath") {preview = [this.filterPreview(asciimath)]}
|
||||
else if (this.config.preview instanceof Array) {preview = this.config.preview}
|
||||
var preview = this.config.preview;
|
||||
if (preview === "AsciiMath") {preview = [this.filterPreview(asciimath)]}
|
||||
if (preview) {
|
||||
preview = MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass},preview);
|
||||
this.insertNode(preview);
|
||||
|
|
|
@ -70,9 +70,8 @@ MathJax.Extension.jsMath2jax = {
|
|||
},
|
||||
|
||||
createPreview: function (node) {
|
||||
var preview;
|
||||
if (this.config.preview === "TeX") {preview = [this.filterPreview(node.innerHTML)]}
|
||||
else if (this.config.preview instanceof Array) {preview = this.config.preview}
|
||||
var preview = this.config.preview;
|
||||
if (preview === "TeX") {preview = [this.filterPreview(node.innerHTML)]}
|
||||
if (preview) {
|
||||
preview = MathJax.HTML.Element("span",{className: MathJax.Hub.config.preRemoveClass},preview);
|
||||
node.parentNode.insertBefore(preview,node);
|
||||
|
|
|
@ -172,15 +172,15 @@ MathJax.Extension.mml2jax = {
|
|||
},
|
||||
quoteHTML: function (string) {
|
||||
if (string == null) {string = ""}
|
||||
return string.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");
|
||||
return string.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""");
|
||||
},
|
||||
|
||||
createPreview: function (math,script) {
|
||||
var preview;
|
||||
if (this.config.preview === "alttext") {
|
||||
var preview = this.config.preview;
|
||||
if (preview === "alttext") {
|
||||
var text = math.getAttribute("alttext");
|
||||
if (text != null) {preview = [this.filterPreview(text)]}
|
||||
} else if (this.config.preview instanceof Array) {preview = this.config.preview}
|
||||
}
|
||||
if (preview) {
|
||||
preview = MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass},preview);
|
||||
script.parentNode.insertBefore(preview,script);
|
||||
|
|
|
@ -271,9 +271,8 @@ MathJax.Extension.tex2jax = {
|
|||
},
|
||||
|
||||
createPreview: function (mode,tex) {
|
||||
var preview;
|
||||
if (this.config.preview === "TeX") {preview = [this.filterPreview(tex)]}
|
||||
else if (this.config.preview instanceof Array) {preview = this.config.preview}
|
||||
var preview = this.config.preview;
|
||||
if (preview === "TeX") {preview = [this.filterPreview(tex)]}
|
||||
if (preview) {
|
||||
preview = MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass},preview);
|
||||
this.insertNode(preview);
|
||||
|
|
Loading…
Reference in New Issue
Block a user