vendor(editor): add CodeJar attribution header + source-form rationale

Brings codejar.js to parity with prism.js, which already carries a
self-documenting header. The README also now records *why* the
unminified source form was chosen: CSP rules out runtime sourcemap
loading from a CDN, so debuggability lives in the vendored bytes.
SHA256 column updated to match the new file content.

Addresses Minor #1 + #2 from the Task 1 code review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mwiegand 2026-05-16 19:10:39 +02:00
parent f5ac61d99b
commit 02e9edd4ed
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

View file

@ -8,7 +8,12 @@ verbatim from the upstream releases below. The strict CSP
|---|---|---|---|
| `prism.js` | jsdelivr concat: prism-core.min.js + prism-clike.min.js + prism-bash.min.js | v1.29.0 | `636b6ce9db1eddd5b60992bb34e3fbc1c3364bce7c312f798f20a16011d7681c` |
| `prism.css` | https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism.min.css | v1.29.0 | `928e23e6b9fcef82c5f1d1f05b6f7fc5a6e187c60195e59fbf16fc9d071ee057` |
| `codejar.js` | https://cdn.jsdelivr.net/npm/codejar@4.0.0/dist/codejar.js + ESM-strip + browser-global shim | v4.0.0 | `c13c2df70a0712acb6440ff5a19ec0afe46d3e811fcb6c4fecd1fde73ae94486` |
| `codejar.js` | https://cdn.jsdelivr.net/npm/codejar@4.0.0/dist/codejar.js + ESM-strip + attribution header + browser-global shim | v4.0.0 | `1d05dc0fdc6941c3ea0c865612843d098e271155b9258b4cbbc4095b07318d3b` |
CodeJar ships in source form (not minified) — chosen here over the
minified variant because the strict CSP rules out runtime sourcemap
loading from a CDN, and readable vendor source meaningfully helps
debugging when something goes wrong in the editor widget.
## Regenerating
@ -17,6 +22,7 @@ verbatim from the upstream releases below. The strict CSP
an updated `VER`, then re-download the theme CSS.
- **CodeJar:** Re-download from jsdelivr per the same plan's Task 1
Step 2 (`dist/codejar.js`, not the bare `codejar.js` which does not
exist in v4.x), strip ESM exports, re-append the `window.CodeJar` shim.
exist in v4.x), strip ESM exports, prepend the in-file attribution
header, re-append the `window.CodeJar` shim.
Bump the version + SHA columns in this table after any update.

View file

@ -1,3 +1,6 @@
/* CodeJar v4.0.0 — https://cdn.jsdelivr.net/npm/codejar@4.0.0/dist/codejar.js
* Local edits: leading `export` keyword stripped from `function CodeJar`;
* `window.CodeJar = CodeJar;` shim appended at EOF for non-module <script> use. */
const globalWindow = window;
function CodeJar(editor, highlight, opt = {}) {
const options = {