Commit Graph

10 Commits

Author SHA1 Message Date
Daniel Hollas dce1a1b0a1 FEATURE: Add KaTeX rendering support (#15)
* FEATURE: Add KaTeX in-browser rendering support.

* Remove ttf fonts from KaTeX

* Update KaTeX to v0.10.1, fix paths to fonts.

Font loading was fixed by rebuilding KaTeX
and specifiying absolute paths to fonts in CSS:
Steps to build KaTeX:

1. `git clone https://github.com/KaTeX/KaTeX.git && cd KaTeX`
    `git submodule update --init --recursive`

2. Change paths to fonts:
    `sed -ri 's/@font-folder.+$/@font-folder:
"\/plugins\/discourse-math\/katex\/fonts";/'
submodules/katex-fonts/fonts.less`

3. Disable TTF fonts:
   `export USE_TTF=false`
    Alternatively, we could modify `.browserslistrc` to match what
Discourse supports

3. Build KaTeX
   `yarn && yarn builld`

4. Copy `katex.min.js` and `katex.min.css` from `dist/` to
`discourse-math/public/katex/`

5. Update fonts, copy woff and woff2 files from
`submodules/katex-fonts/fonts`

* Minor copy edit to settings

Mark MathKJax only settings

* Add Mhchem extension for KaTeX.

It is already automatically loaded for MathJaX.
2019-03-05 07:35:00 +11:00
Kyle Zhao d98bc41f18 FIX: configure mathjax to use CDN (#14) 2018-11-22 09:11:53 +11:00
Sam fd5258cb3c SECURITY: do not allow tags in math wrapper 2018-08-17 16:14:27 +10:00
Sam 28162e9ded MathJax upgrade to version 2.7.5 2018-08-08 11:58:37 +10:00
mcmcclur 05d52f593f Add asciimath processing (#10)
This version sets the new asciimath parsing to be an option. It also deals with the old zoom_on_hover and enable_accessibility options a bit better.
2018-05-29 08:54:56 +10:00
Sam 0329745f84 don't decorate non math 2017-11-20 15:06:24 +11:00
Guo Xiang Tan 669f756b34 Make eslint happy. 2017-08-02 18:18:43 +09:00
mcmcclur 611840a32d Add options for zoom and accessibility (#6)
* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload
2017-07-28 16:14:55 -04:00
Sam 84d7bfc02f bug fixes 2017-07-06 17:15:37 -04:00
Sam 5b22a196fa Initial commit 2017-07-06 16:50:38 -04:00