/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/asciimath2jax.js * * Implements the AsciiMath to Jax preprocessor that locates AsciiMath * code within the text of a document and replaces it with SCRIPT tags for * processing by MathJax. * * Modified by David Lippman, based on tex2jax.js. * Additional work by Davide P. Cervone. * * --------------------------------------------------------------------- * * Copyright (c) 2012-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */MathJax.Extension.asciimath2jax={version:"2.2",config:{delimiters:[["`","`"]],skipTags:"script noscript style textarea pre code".split(" "),ignoreClass:"asciimath2jax_ignore",processClass:"asciimath2jax_process",preview:"AsciiMath"},PreProcess:function(a){this.configured||(this.config=MathJax.Hub.CombineConfig("asciimath2jax",this.config),this.config.Augment&&MathJax.Hub.Insert(this,this.config.Augment),this.configured=!0);"string"===typeof a&&(a=document.getElementById(a));a||(a=document.body);this.createPatterns()&&this.scanElement(a,a.nextSibling)},createPatterns:function(){var a=[],b,d,c=this.config;this.match={};if(0===c.delimiters.length)return!1;b=0;for(d=c.delimiters.length;b(document.documentMode||0)};MathJax.Hub.Register.PreProcessor(["PreProcess",MathJax.Extension.asciimath2jax]);MathJax.Ajax.loadComplete("[MathJax]/extensions/asciimath2jax.js");