GithubHelp home page GithubHelp logo

bhanditz / mathjax-parser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bersling/mathjax-parser

0.0 2.0 0.0 63 KB

Find & Replace the mathjax delimiters in a HTML string

Home Page: https://www.bersling.com/2017/01/22/mathjax-parser-for-html-strings/

JavaScript 23.61% Smarty 1.63% TypeScript 67.94% HTML 6.82%

mathjax-parser's Introduction

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/

mathjax-parser's People

Contributors

bersling avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.