Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply proper MathJax #9

Closed
benoit74 opened this issue Oct 1, 2024 · 0 comments · Fixed by #31
Closed

Apply proper MathJax #9

benoit74 opened this issue Oct 1, 2024 · 0 comments · Fixed by #31
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@benoit74
Copy link
Contributor

benoit74 commented Oct 1, 2024

Once #7 is implemented, we need to properly install MathJax, i.e. proper version and configuration.

Both seems to be present in page content on the API, in the tail attribute.

{
...,
"tail": "<!-- Google tag (gtag.js) -->\r\n<script async=\"async\" src=\"https://www.googletagmanager.com/gtag/js?id=G-QBY3PCNWX9\"></script>\r\n<script>/*<![CDATA[*/\r\n  window.dataLayer = window.dataLayer || [];\r\n  function gtag(){dataLayer.push(arguments);}\r\n  gtag('js', new Date());\r\n\r\n  gtag('config', 'G-QBY3PCNWX9');\r\n/*]]>*/</script>\r\n\r\n<script type=\"text/x-mathjax-config\">/*<![CDATA[*/\r\n  MathJax.Ajax.config.path[\"mhchem\"] =\r\n  \"https://cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.3.2\";\r\n  MathJax.Hub.Config({ jax: [\"input/TeX\",\"input/MathML\",\"output/SVG\"],\r\n  extensions: [\"tex2jax.js\",\"mml2jax.js\",\"MathMenu.js\",\"MathZoom.js\"],\r\n  TeX: {\r\n    extensions: [\"autobold.js\",\"mhchem.js\",\"color.js\",\"cancel.js\", \"AMSmath.js\",\"AMSsymbols.js\",\"noErrors.js\",\"noUndefined.js\"]\r\n  },\r\n    \"HTML-CSS\": { linebreaks: { automatic: true , width: \"90%\"}, scale: 85, mtextFontInherit: false},\r\nmenuSettings: { zscale: \"150%\", zoom: \"Double-Click\" },\r\n         SVG: { linebreaks: { automatic: true } }});\r\n/*]]>*/</script>\r\n\r\n<script type=\"text/javascript\" async=\"true\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML\"></script>"
}

So MathJax is not something supposed to be applied unconditionally on all pages (especially if we want the scraper to stay generic). We could theoretically have different MathJax version on same website.

It is however clear that we have other stuff on this attribute (here Google Tag). Maybe we should just clean / keep only mathjax related stuff.

@benoit74 benoit74 added the enhancement New feature or request label Oct 1, 2024
@benoit74 benoit74 added this to the 0.1 milestone Oct 1, 2024
@benoit74 benoit74 self-assigned this Oct 1, 2024
@benoit74 benoit74 changed the title Apply proper MathJax / head / tail JS Apply proper MathJax Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant