HTML.js 1.4 KB

12345678910111213
  1. /*
  2. * /MathJax/extensions/TeX/HTML.js
  3. *
  4. * Copyright (c) 2009-2013 The MathJax Consortium
  5. *
  6. * Part of the MathJax library.
  7. * See http://www.mathjax.org for details.
  8. *
  9. * Licensed under the Apache License, Version 2.0;
  10. * you may not use this file except in compliance with the License.
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. */MathJax.Extension["TeX/HTML"]={version:"2.2"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var c=MathJax.InputJax.TeX;c.Definitions.Add({macros:{href:"HREF_attribute","class":"CLASS_attribute",style:"STYLE_attribute",cssId:"ID_attribute"}},null,!0);c.Parse.Augment({HREF_attribute:function(a){var b=this.GetArgument(a);a=this.GetArgumentMML(a);this.Push(a.With({href:b}))},CLASS_attribute:function(a){var b=this.GetArgument(a);a=this.GetArgumentMML(a);null!=a["class"]&&(b=a["class"]+" "+b);this.Push(a.With({"class":b}))},STYLE_attribute:function(a){var b=this.GetArgument(a);a=this.GetArgumentMML(a);null!=a.style&&(";"!==b.charAt(b.length-1)&&(b+=";"),b=a.style+" "+b);this.Push(a.With({style:b}))},ID_attribute:function(a){var b=this.GetArgument(a);a=this.GetArgumentMML(a);this.Push(a.With({id:b}))},GetArgumentMML:function(a){a=this.ParseArg(a);a.inferred&&1==a.data.length?a=a.data[0]:delete a.inferred;return a}});MathJax.Hub.Startup.signal.Post("TeX HTML Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/HTML.js");