Download mathly2/static/math.js from wzender/mathly: direct link, hf CLI and curl.
- Browser
- Download file 445 Bytes
-
https://huggingface.co/spaces/wzender/mathly/resolve/main/mathly2/static/math.js
- Command line
-
hf download hf://spaces/wzender/mathly/mathly2/static/math.js
-
curl -L -o math.js https://huggingface.co/spaces/wzender/mathly/resolve/main/mathly2/static/math.js
445 Bytes
| // Shared text helpers. The bank writes math as plain text between $…$ (for example "$x² − 2x − 15$"). | |
| // fmt() escapes the text and wraps each $…$ in <span class="m">, which math-tex.js draws as a formula. | |
| export const esc = s => String(s ?? "").replace(/[&<>"']/g, c => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c])); | |
| export const fmt = s => esc(s).replace(/\$([^$]+)\$/g, '<span class="m">$1</span>'); | |