{"id":15757248,"url":"https://github.com/asnunes/mathjax3-react","last_synced_at":"2025-10-14T12:49:54.454Z","repository":{"id":40289708,"uuid":"239190404","full_name":"asnunes/mathjax3-react","owner":"asnunes","description":"React component to load MathJax v3 and process raw ASCIImath and TeX formulas or HTML content.","archived":false,"fork":false,"pushed_at":"2024-04-17T20:43:12.000Z","size":1093,"stargazers_count":14,"open_issues_count":7,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-13T22:42:18.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asnunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-08T19:13:05.000Z","updated_at":"2025-03-21T06:30:03.000Z","dependencies_parsed_at":"2023-11-24T17:26:48.058Z","dependency_job_id":"701c8c1c-7cd3-41ae-8e79-9c14e024f3d6","html_url":"https://github.com/asnunes/mathjax3-react","commit_stats":{"total_commits":65,"total_committers":3,"mean_commits":"21.666666666666668","dds":0.09230769230769231,"last_synced_commit":"e5b601efd4109362abb16a9286a88efd34ea6478"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/asnunes/mathjax3-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fmathjax3-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fmathjax3-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fmathjax3-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fmathjax3-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asnunes","download_url":"https://codeload.github.com/asnunes/mathjax3-react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fmathjax3-react/sbom","scorecard":{"id":212644,"data":{"date":"2025-08-11","repo":{"name":"github.com/asnunes/mathjax3-react","commit":"0f85626fc4021b677f520e13e80f4b81b6f32018"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/asnunes/mathjax3-react/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/asnunes/mathjax3-react/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/asnunes/mathjax3-react/publish.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish.yml:20","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-92r3-m2mg-pj97","Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw","Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g","Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3","Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3","Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T01:02:16.558Z","repository_id":40289708,"created_at":"2025-08-17T01:02:16.558Z","updated_at":"2025-08-17T01:02:16.558Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018576,"owners_count":26086579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T09:05:04.261Z","updated_at":"2025-10-14T12:49:54.422Z","avatar_url":"https://github.com/asnunes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MathJax3 - React\n\nReact component to easily load MathJax **v3** and process **dynamically** raw ASCIIMath, TeX or MathML content.\n\n## Installation\n\nNPM:\n\n`npm install mathjax3-react --save`\n\nYARN:\n\n`yarn add mathjax3-react`\n\n## Basic usage\n\n#### From HTML String\n\n```javascript\nimport React from 'react';\nimport { MathJaxProvider, MathJaxHtml } from 'mathjax3-react';\n\nfunction App() {\n  return (\n    \u003cdiv\u003e\n      \u003cMathJaxProvider\u003e\n        \u003cMathJaxHtml html={html} /\u003e\n      \u003c/MathJaxProvider\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\nHTML string:\n\n```javascript\nconst html = `\n\u003cp\u003eLet's analise this equation:\u003c/p\u003e\n\u003cp style=\"text-align:center;\"\u003e\n  \u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\n    \u003cmsup\u003e\n      \u003cmrow\u003e\n        \u003cmi\u003er\u003c/mi\u003e\n      \u003c/mrow\u003e\n      \u003cmrow\u003e\n        \u003cmn\u003e2\u003c/mn\u003e\n      \u003c/mrow\u003e\n    \u003c/msup\u003e\n    \u003cmo\u003e+\u003c/mo\u003e\n    \u003cmsup\u003e\n      \u003cmrow\u003e\n        \u003cmi\u003ez\u003c/mi\u003e\n      \u003c/mrow\u003e\n      \u003cmrow\u003e\n        \u003cmn\u003e2\u003c/mn\u003e\n      \u003c/mrow\u003e\n    \u003c/msup\u003e\n    \u003cmo\u003e=\u003c/mo\u003e\n    \u003cmn\u003e4\u003c/mn\u003e\n  \u003c/math\u003e\n\u003c/p\u003e\n`;\n```\n\nResult:\n\n![basic html example](./docs/images/html-basic.png)\n\n### TeX or AsciiMath formula\n\n```javascript\nimport React from 'react';\nimport { MathJaxProvider, MathJaxFormula } from 'mathjax3-react';\n\nfunction basicUsage() {\n  return (\n    \u003cdiv\u003e\n      \u003cMathJaxProvider\u003e\n        \u003cMathJaxFormula formula=\"$$\\int x^2dx$$\" /\u003e\n      \u003c/MathJaxProvider\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default basicUsage;\n```\n\nResult:\n\n![basic formula example](./docs/images/formula-basic.png)\n\n## MathJaxProvider Component\n\nThe `MathJaxProvider` component must be used as a parent for the `MathJaxHtml` and `MathJaxFormula` components. This is essential because `MathJaxProvider` is responsible for loading the MathJax script, which the `MathJaxHtml` or `MathJaxFormula` components will consume and utilize.\n\n**Rationale Behind This Design**\n\nLoading MathJax is a resource-intensive process. To optimize performance, `MathJaxProvider` should be placed high in your component hierarchy to load the MathJax script only once. This approach prevents the script from being reloaded unnecessarily and allows `MathJaxHtml` and `MathJaxFormula` components to operate within contexts that update more frequently, thereby leveraging the pre-loaded MathJax script efficiently.\n\n```tsx\nimport React from 'react';\nimport { MathJaxProvider, MathJaxFormula } from 'mathjax3-react';\n\nfunction MathInterleavedWithText() {\n  return (\n    \u003cdiv\u003e\n      \u003cp\u003eConsider the following integral as an example:\u003c/p\u003e\n      \u003cMathJaxFormula formula=\"\\\\int x^2dx\" /\u003e\n      \u003cp\u003eEuler's identity is an astonishing formula in the field of mathematics:\u003c/p\u003e\n      \u003cMathJaxFormula formula=\"e^{i\\\\pi} + 1 = 0\" /\u003e\n      {/* More content and formulas can be added here */}\n    \u003c/div\u003e\n  );\n}\n\nfunction App() {\n  return (\n    \u003cMathJaxProvider\u003e\n      \u003ch1\u003eMathematical Concepts\u003c/h1\u003e\n      \u003cMathInterleavedWithText /\u003e\n    \u003c/MathJaxProvider\u003e\n  );\n}\n\nexport default App;\n```\n\n### Custom options\n\nYou can set custom script url or MathJax by sending them as props to `MathJax.Provider` component\n\n```javascript\nimport React from 'react';\nimport { MathJaxProvider, MathJaxFormula } from 'mathjax3-react';\n\nfunction customOptions() {\n  return (\n    \u003cdiv\u003e\n      \u003cMathJaxProvider\n        url=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js\"\n        options={{\n          tex: {\n            inlineMath: [\n              ['$', '$'],\n              ['\\\\(', '\\\\)'],\n            ],\n          },\n        }}\n      \u003e\n        \u003cMathJaxFormula formula=\"Euler's identity: $e^{i\\pi} = -1$\" /\u003e\n      \u003c/MathJaxProvider\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default customOptions;\n```\n\nResult:\n\n![custom formula example](./docs/images/formula-custom.png)\n\n**Which options are available?**\n\nOptions props are exactly the same options used in MathJax lib. So you can use [official MathJax documentation](https://docs.mathjax.org/en/latest/web/configuration.html) to set custom options.\n\n### Custom Input\n\n```javascript\nimport React, { useState } from 'react';\nimport { MathJaxProvider, MathJaxFormula } from 'mathjax3-react';\n\nfunction CustomInput() {\n  const [value, setValue] = useState('\\\\int_{-\\\\infty}^{+\\\\infty} e^{-x^2} dx = \\\\sqrt{\\\\pi}');\n\n  return (\n    \u003cdiv className=\"App\"\u003e\n      \u003ch1\u003eCustom Math Input\u003c/h1\u003e\n      \u003cinput type=\"text\" value={value} onChange={(e) =\u003e setValue(e.target.value)} style={{ width: '100%' }} /\u003e\n      \u003cMathJaxProvider\u003e\n        \u003cMathJaxFormula formula={'$$' + value + '$$'} /\u003e\n      \u003c/MathJaxProvider\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default CustomInput;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasnunes%2Fmathjax3-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasnunes%2Fmathjax3-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasnunes%2Fmathjax3-react/lists"}