/* * /MathJax/extensions/TeX/noErrors.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 */(function(c,h){var g=c.CombineConfig("TeX.noErrors",{disabled:!1,multiLine:!0,inlineDelimiters:["",""],style:{"font-size":"90%","text-align":"left",color:"black",padding:"1px 3px",border:"1px solid"}});MathJax.Extension["TeX/noErrors"]={version:"2.2",config:g};c.Register.StartupHook("TeX Jax Ready",function(){var a=MathJax.InputJax.TeX.formatError;MathJax.InputJax.TeX.Augment({formatError:function(l,f,k,b){if(g.disabled)return a.apply(this,arguments);var d=l.message.replace(/\n.*/,"");c.signal.Post(["TeX Jax - parse error",d,f,k,b]);var d=g.inlineDelimiters,e=k||g.multiLine;k||(f=d[0]+f+d[1]);f=e?f.replace(/ /g,"\u00a0"):f.replace(/\n/g," ");return MathJax.ElementJax.mml.merror(f).With({isError:!0,multiLine:e})}})});c.Register.StartupHook("HTML-CSS Jax Config",function(){c.Config({"HTML-CSS":{styles:{".MathJax .noError":c.Insert({"vertical-align":c.Browser.isMSIE&&g.multiLine?"-2px":""},g.style)}}})});c.Register.StartupHook("HTML-CSS Jax Ready",function(){var a=MathJax.ElementJax.mml,c=MathJax.OutputJax["HTML-CSS"],f=a.math.prototype.toHTML,k=a.merror.prototype.toHTML;a.math.Augment({toHTML:function(b,d){var e=this.data[0];e&&e.data[0]&&e.data[0].isError?(b.style.fontSize="",b=this.HTMLcreateSpan(b),b.bbox=e.data[0].toHTML(b).bbox):b=f.call(this,b,d);return b}});a.merror.Augment({toHTML:function(b){if(!this.isError)return k.call(this,b);b=this.HTMLcreateSpan(b);b.className="noError";this.multiLine&&(b.style.display="inline-block");for(var d=this.data[0].data[0].data.join("").split(/\n/),e=0,a=d.length;e