Sha256: 152d10593a41119c61557216e66d1dee2315d15b81951dbee3c97c6366022970

Contents?: true

Size: 1.88 KB

Versions: 26

Compression:

Stored size: 1.88 KB

Contents

/*************************************************************
 *
 *  MathJax/jax/output/HTML-CSS/autoload/ms.js
 *  
 *  Implements the HTML-CSS output for <ms> elements.
 *
 *  ---------------------------------------------------------------------
 *  
 *  Copyright (c) 2010 Design Science, Inc.
 * 
 *  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.
 */

(function (MML) {
  
  MML.ms.Augment({
    toHTML: function (span) {
      span = this.HTMLhandleSize(this.HTMLcreateSpan(span));
      var values = this.getValues("lquote","rquote");
      var text = this.data.join("");  // FIXME:  handle mglyph?
      var pattern = [];
      if (values.lquote.length === 1) {pattern.push(this.HTMLquoteRegExp(values.lquote))}
      if (values.rquote.length === 1) {pattern.push(this.HTMLquoteRegExp(values.rquote))}
      if (pattern.length) {text = text.replace(RegExp("("+pattern.join("|")+")","g"),"\\$1")}
      this.HTMLhandleVariant(span,this.HTMLgetVariant(),values.lquote+text+values.rquote);
      this.HTMLhandleSpace(span);
      this.HTMLhandleColor(span);
    },
    HTMLquoteRegExp: function (string) {
      return string.replace(/([.*+?|{}()\[\]\\])/g,"\\$1");
    }
  });
  MML.ms.prototype.defaults.fontfamily = 'monospace';
  
  MathJax.Hub.Startup.signal.Post("HTML-CSS ms Ready");
  
})(MathJax.ElementJax.mml);

MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].autoloadDir+"/ms.js");

Version data entries

26 entries across 26 versions & 4 rubygems

Version Path
gollum-site-0.0.1 lib/gollum-site/layout/javascript/MathJax/jax/output/HTML-CSS/autoload/ms.js
orange-gollum-1.0.0 lib/orange-gollum/assets/js/MathJax/jax/output/HTML-CSS/autoload/ms.js
tecnh-gollum-1.0.2.auth2 lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/ms.js
tecnh-gollum-1.0.2.auth lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/ms.js
gollum-1.0.1 lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/ms.js
gollum-1.0.0 lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/ms.js