GeezerVison is showing github.com — feat: KaTeX CSS/font 完全オフライン化 + tmp 脆弱性解消 by ymnao · Pull Request #145 · ymnao/scripta
Conversation
ymnao
commented
Jun 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Closes #121
Test plan
-
pnpm verify(format / lint / typecheck / test / e2e / build)通過
-
pnpm test:e2e 160 tests passed
-
pnpm test:e2e:electron(実 Electron 起動モード)
- 実アプリで数式を含む Markdown を PDF / HTML export し、オフラインで数式が正しく表示されることを確認
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- scripts/generate-katex-css.js でビルド時に katex.min.css の woff2 font を
data: URI に inline 化し src/generated/katex-inline-css.ts に書き出す
- export.ts の CDN <link> を <style> による inline 埋め込みに置換
- woff/ttf fallback を除去(woff2 は全モダンブラウザ対応済み)
- postinstall / dev / build の scripts に生成スクリプトを chain
Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- buildFence を code-fence.ts へ移動し、MarkdownEditor が export.ts を
eager import しなくなった(katexInlineCss ~368KB の起動時ロード回避)
- generate-katex-css.js に mtime チェック追加(up-to-date なら即終了)
- woff/ttf 除去 regex を 1 つに統合
- dist / test:e2e:electron の scripts に generate chain を追加(漏れ修正)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
src/generated/ は gitignore のため、postinstall 未実行の状態で
typecheck / test / dev:e2e 等を単独実行すると TS2307 で失敗していた。
生成スクリプトの mtime チェックにより up-to-date 時は即終了するため、
全コマンドに chain しても実行コストは無視可能。
Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
HTML/PDF export は inline CSS 化済みだが、プロンプト export の
指示文に CDN 利用の記述が残っていた。オフライン化の方針に合わせて
インライン CSS + data URL font の埋め込み指示に変更。
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- mtime 比較による早期終了を削除。pnpm は package files に元の
mtime を保持する場合があり、katex 更新時に再生成されない恐れがあった
- 生成スクリプトに変換後の self-check を追加(url(fonts/) や
https?:// が CSS に残っていたら即エラー)
- テストに data:font/woff2;base64 の存在確認と url(fonts/) 不在、
外部 stylesheet link 不在の assertion を追加
Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.