Skip to content

Extract hardcoded CDN URLs into a constants file #8

Description

@coderanik

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

  1. 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",
};
  1. Import and use these constants in LatexHtmlPreview.tsx

Difficulty: Easy

Estimated Time: 20 minutes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions