Properly handle preview of 'none' in all preprocessors, and preview of 'alttext' in mml2jax. See note on commit d2bbe75.

This commit is contained in:
Davide P. Cervone 2013-04-26 13:29:35 -04:00
parent e253967b72
commit 9178a9af0e
3 changed files with 5 additions and 2 deletions

View File

@ -204,6 +204,7 @@ MathJax.Extension.asciimath2jax = {
createPreview: function (mode,asciimath) {
var preview = this.config.preview;
if (preview === "none") return;
if (preview === "AsciiMath") {preview = [this.filterPreview(asciimath)]}
if (preview) {
preview = MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass},preview);

View File

@ -177,9 +177,10 @@ MathJax.Extension.mml2jax = {
createPreview: function (math,script) {
var preview = this.config.preview;
if (preview === "none") return;
if (preview === "alttext") {
var text = math.getAttribute("alttext");
if (text != null) {preview = [this.filterPreview(text)]}
if (text != null) {preview = [this.filterPreview(text)]} else {preview = null}
}
if (preview) {
preview = MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass},preview);

View File

@ -274,6 +274,7 @@ MathJax.Extension.tex2jax = {
createPreview: function (mode,tex) {
var preview = this.config.preview;
if (preview === "none") return;
if (preview === "TeX") {preview = [this.filterPreview(tex)]}
if (preview) {
preview = MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass},preview);