mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(client): render MathJax in jaws header (#53370)
This commit is contained in:
@@ -2,6 +2,8 @@ import { withPrefix } from 'gatsby';
|
||||
import i18next from 'i18next';
|
||||
import React from 'react';
|
||||
|
||||
import { isMathJaxAllowed, mathJaxSrc } from '../src/utils/math-jax';
|
||||
|
||||
export function getheadTagComponents(): JSX.Element[] {
|
||||
const socialImage =
|
||||
'https://cdn.freecodecamp.org/platform/universal/fcc_meta_1920X1080-indigo.png';
|
||||
@@ -59,15 +61,12 @@ export function getPostBodyComponents(pathname: string): JSX.Element[] {
|
||||
async={false}
|
||||
id='mathjax'
|
||||
key='mathjax'
|
||||
src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML'
|
||||
src={mathJaxSrc}
|
||||
type='text/javascript'
|
||||
/>
|
||||
);
|
||||
|
||||
if (
|
||||
pathname.includes('/learn/rosetta-code') ||
|
||||
pathname.includes('/learn/project-euler/')
|
||||
) {
|
||||
if (isMathJaxAllowed(pathname)) {
|
||||
scripts.push(mathJaxScriptElement);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user