Description
Three CDN URLs (for latex.js base.css, article.css, and KaTeX) are hardcoded as strings inside the LatexHtmlPreview component. These should be extracted to a constants file so they can be easily updated when library versions change.
Location
frontend/src/components/LatexHtmlPreview.tsx:62,69,76
Suggested Fix
- Create
frontend/src/lib/cdnUrls.ts:
export const CDN_URLS = {
LATEX_BASE: "https://cdn.jsdelivr.net/npm/latex.js@0.12.6/dist/css/base.css",
LATEX_ARTICLE: "https://cdn.jsdelivr.net/npm/latex.js@0.12.6/dist/css/article.css",
KATEX: "https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css",
};
- Import and use these constants in
LatexHtmlPreview.tsx
Difficulty: Easy
Estimated Time: 20 minutes
Description
Three CDN URLs (for latex.js base.css, article.css, and KaTeX) are hardcoded as strings inside the
LatexHtmlPreviewcomponent. These should be extracted to a constants file so they can be easily updated when library versions change.Location
frontend/src/components/LatexHtmlPreview.tsx:62,69,76Suggested Fix
frontend/src/lib/cdnUrls.ts:LatexHtmlPreview.tsxDifficulty: Easy
Estimated Time: 20 minutes