Enable single-dollar inline LaTeX rendering in MathJax#62
Enable single-dollar inline LaTeX rendering in MathJax#62ThisIs-Developer merged 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/25e889c7-d501-4e74-9e49-01839bcf0feb Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Deploying markdown-viewer with
|
| Latest commit: |
4144576
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ab1fb9f9.markdown-viewer.pages.dev |
| Branch Preview URL: | https://copilot-fix-latex-inline-ren.markdown-viewer.pages.dev |
Deploying markdownviewer with
|
| Latest commit: |
4144576
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1644964b.markdownviewer.pages.dev |
| Branch Preview URL: | https://copilot-fix-latex-inline-ren.markdownviewer.pages.dev |
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/25e889c7-d501-4e74-9e49-01839bcf0feb Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/25e889c7-d501-4e74-9e49-01839bcf0feb Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Configures MathJax so inline LaTeX wrapped with single dollar delimiters ($...$) renders correctly (in addition to existing display math support), aiming for consistent behavior across web and desktop builds.
Changes:
- Added an explicit
window.MathJaxconfiguration (inline + display delimiters,processEscapes) before loading the MathJax bundle. - Applied the same MathJax setup in both
index.htmlanddesktop-app/resources/index.html. - Updated the desktop GitHub import modal markup to include a selection toolbar and tree container (additional change beyond MathJax scope).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| index.html | Adds MathJax delimiter configuration prior to loading MathJax to enable $...$ inline rendering. |
| desktop-app/resources/index.html | Mirrors the MathJax config and also introduces additional GitHub import modal UI elements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako.min.js" integrity="sha384-rNlaE5fs9dGIjmxWDALQh/RBAaGRYT5ChrzHo6tRfgrZ36iRFAiquP5g41Jsv+0j" crossorigin="anonymous"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script> |
There was a problem hiding this comment.
js-yaml is newly loaded here, but the desktop bundle (desktop-app/resources/js/script.js and main.js) doesn’t reference the jsyaml global. If it’s not needed on desktop, consider removing this script tag to avoid an extra CDN dependency and unnecessary load time; if it is needed, add/verify the corresponding usage so this include is justified.
| <script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script> |
| <div id="github-import-selection-toolbar" class="github-import-selection-toolbar" style="display:none;"> | ||
| <span id="github-import-selected-count" class="github-import-selected-count">0 selected</span> | ||
| <button type="button" class="reset-modal-btn" id="github-import-select-all">Select All</button> | ||
| </div> | ||
| <div id="github-import-tree" class="github-import-tree" style="display:none;"></div> |
There was a problem hiding this comment.
This change introduces the GitHub import selection toolbar and tree container, but desktop-app/resources/js/script.js currently implements GitHub import via the <select id="github-import-file-select"> flow and doesn’t reference these new elements/IDs. Either wire up the desktop GitHub import logic to use the new tree-based UI (matching the web implementation) or remove these unused elements to keep the desktop UI/DOM minimal and avoid future confusion.
| <div id="github-import-selection-toolbar" class="github-import-selection-toolbar" style="display:none;"> | |
| <span id="github-import-selected-count" class="github-import-selected-count">0 selected</span> | |
| <button type="button" class="reset-modal-btn" id="github-import-select-all">Select All</button> | |
| </div> | |
| <div id="github-import-tree" class="github-import-tree" style="display:none;"></div> |
| <div id="github-import-selection-toolbar" class="github-import-selection-toolbar" style="display:none;"> | ||
| <span id="github-import-selected-count" class="github-import-selected-count">0 selected</span> | ||
| <button type="button" class="reset-modal-btn" id="github-import-select-all">Select All</button> | ||
| </div> | ||
| <div id="github-import-tree" class="github-import-tree" style="display:none;"></div> |
There was a problem hiding this comment.
The PR description is scoped to MathJax delimiter configuration, but this hunk also changes the GitHub import modal UI (selection toolbar + file tree) for the desktop app. Please confirm this is intentional and update the PR description (or split into a separate PR) so reviewers understand the additional behavior/UI change being shipped.
Inline LaTeX expressions wrapped with single
$...$were rendering as plain text, while$$...$$display math rendered correctly. This PR configures MathJax delimiter parsing so inline and display expressions are both handled as expected.MathJax initialization
window.MathJaxconfig before loading the MathJax bundle.\(...\).$$...$$and\[...\].processEscapesto avoid unintended parsing for escaped dollar signs.Web + desktop parity
index.htmldesktop-app/resources/index.html