4.0.7 • Published 7 years ago

mathjax-parser v4.0.7

Weekly downloads
95
License
MIT
Repository
github
Last release
7 years ago

mathjax-parser

Build Status

A simple mathjax parser in order to find and replace occurences of mathjax in a HTML String. No Jquery. Zero Regex. 0 Code Warnings. 10+ unit tests.

Installation

npm install --save mathjax-parser

Running the parser

var parser = new MathjaxParser();
parser.parse(demoString).outputHtml;

See the demo.html or the plunker.

Providing a configuration

Running the parser without a configuration is a bit pointless. Provide it with a config that looks like this:

var parser = new MathjaxParser();

var config = {
          inlineMath: [['$','$'],['\\(','\\)']],
          displayMath: [['$$','$$'],['\\[','\\]']],
          inlineMathReplacement: ['XXX', 'XXX'],
          displayMathReplacement: ['YYY','ZZZ']
        }

parser.parse(demoString, config).outputHtml;

Thoughts behind the parser

A description of the building-and-thought-process of the parser can be found here: https://www.bersling.com/2017/01/22/mathjax-parser-for-html-strings/

4.0.7

7 years ago

4.0.6

7 years ago

4.0.5

7 years ago

4.0.4

7 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago