Katex: Mhchem not loaded on katex.org

Created on 25 Feb 2019  路  8Comments  路  Source: KaTeX/KaTeX

Hi!

I tried to enable mhchem extension that shipped in the new 0.10.1 version on my site. It seems to work although some rendering seems a bit odd (will make another issue for that) so I wanted compare with katex.org test page. It seems that mhchem is not loaded there. I realize that might be by design since mhchem is an extension, but maybe in this case it is worth it to add?

contrib documentation good first issue

Most helpful comment

For now, you can load the extension by running javascript:var a=document.createElement('script');a.src='https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/mhchem.min.js';document.body.appendChild(a) in the developer console or the address bar (please note that some browsers like Chrome strips off javascript: when pasting to the address bar).

All 8 comments

For now, you can load the extension by running javascript:var a=document.createElement('script');a.src='https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/mhchem.min.js';document.body.appendChild(a) in the developer console or the address bar (please note that some browsers like Chrome strips off javascript: when pasting to the address bar).

Nice workaround @ylemkimon.

I think including the mhchem extension in the online demo is a good idea -- show off all our features -- and should be easy to do (just another <script> tag, as above).

In the same spirit, we could also consider including the copy-tex extension -- though that's more useful when there's a mix of inline math and formulas.

It seems like there shouldn't be too much work to add it the demo page.

@kevinbarabash I was looking for a 'good first issue'. If I have understood this issue right, the changes required for this fix isn't on the repo, but on the website katex.org, right?

@mothas The website is on (or published from) the repo, in the website directory (built via Docusaurus -- run yarn and yarn start in that directory to run a test server, after yarn building in the root directory).

I have made a PR #1932 for this issue. Let me know if it looks good.

This is my first time contributing to a project. So apologies in advance in case I missed anything.

Hmm, to do this properly, don't you also need to update the release script to support versioning?

@danielhollas I think our update-sri.js script already handles this, but I've asked for confirmation. Discussion about this should take place on the PR itself, #1932.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaunc picture shaunc  路  4Comments

oddhack picture oddhack  路  3Comments

hagenw picture hagenw  路  3Comments

janosh picture janosh  路  4Comments

pvnr0082t picture pvnr0082t  路  4Comments