Skip to content

Angular markdown component/directive/pipe/service to parse static, dynamic or remote content to html with syntax highlight

License

Notifications You must be signed in to change notification settings

fastestimator-util/ngx-markdown

 
 

Repository files navigation

about

This repo is forked from https://github.com/jfcere/ngx-markdown. The reason for building this repo is ngx-markdown cannot parse the tex mathematical expression perfectly.

Therefore we modify the parsing regex in lib/src/markdown.service.ts.(line 86)
Run npm run build:lib and copy dist/lib/* to this repo's lib branch (lib, lib2)
Please be aware of the validate date of the lincese, it will affect using npm to install this repo.

lib

change regex to \$([^$]+?)\$ to fix the issue of not being able to parse single number in tex.

lib2

change regex to \$([^\s][^$]*?)\$ to fix the issue of not being able to use single dollar sign twice. (it will take everything between them as tex.) Now it will only parse the case when there is not space trailling after dollor sign.

ex:

  • $ echo hello world$ ==> not match
  • $echo hello world$ ==> match

About

Angular markdown component/directive/pipe/service to parse static, dynamic or remote content to html with syntax highlight

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.6%
  • JavaScript 2.4%