mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Vendor the mathjax and highlightjs code to avoid CSP loading
This commit is contained in:
parent
8f02871f67
commit
7d821d1c42
5 changed files with 7 additions and 20 deletions
|
|
@ -1,14 +0,0 @@
|
|||
type AIconProps = {
|
||||
size: number
|
||||
color: string
|
||||
style?: React.CSSProperties
|
||||
}
|
||||
|
||||
export function AIcon(props: AIconProps): JSX.Element {
|
||||
return (
|
||||
<svg style={props.style} width={props.size} height={props.size} viewBox={`0 0 20 20`} fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18.5 18L11.75 5.25L5 18" stroke={props.color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M16.5133 14.25H6.98828" stroke={props.color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ export function Article(props: ArticleProps): JSX.Element {
|
|||
<>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href={`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.4.0/styles/${highlightTheme}.min.css`}
|
||||
href={`/public/static/highlightjs/${highlightTheme}.min.css`}
|
||||
/>
|
||||
<Box
|
||||
ref={articleContentRef}
|
||||
|
|
|
|||
|
|
@ -396,11 +396,11 @@ export default function Home(): JSX.Element {
|
|||
description: article?.description ?? '',
|
||||
}}
|
||||
>
|
||||
<Script async src="/static/scripts/mathJaxConfiguration.js" />
|
||||
<Script async src="/public/static/mathjax/mathJaxConfiguration.js" />
|
||||
<Script
|
||||
async
|
||||
id="MathJax-script"
|
||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
|
||||
src="/public/static/mathjax/tex-mml-chtml.js"
|
||||
/>
|
||||
<Toaster />
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ export default function AppArticleEmbed(): JSX.Element {
|
|||
|
||||
const router = useRouter()
|
||||
|
||||
const [contentProps, setContentProps] =
|
||||
useState<AppArticleEmbedContentProps | undefined>(undefined)
|
||||
const [contentProps, setContentProps] = useState<
|
||||
AppArticleEmbedContentProps | undefined
|
||||
>(undefined)
|
||||
|
||||
useEffect(() => {
|
||||
if (!router.isReady) return
|
||||
|
|
@ -78,7 +79,7 @@ function AppArticleEmbedContent(
|
|||
<Script
|
||||
async
|
||||
id="MathJax-script"
|
||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
|
||||
src="/public/static/tex-mml-chtml.js"
|
||||
/>
|
||||
<VStack
|
||||
alignment="center"
|
||||
|
|
|
|||
Loading…
Reference in a new issue