Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 13-js-api-pygments/py/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"start": "uv run pywrangler dev"
},
"devDependencies": {
"wrangler": "^4.49.0"
"wrangler": "^4.110.0"
}
}
2 changes: 1 addition & 1 deletion 13-js-api-pygments/py/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "node_modules/wrangler/config-schema.json",
"name": "py-rpc-server",
"main": "src/entry.py",
"compatibility_date": "2025-11-02",
"compatibility_date": "2026-06-01",
"compatibility_flags": [
"python_workers"
],
Expand Down
8 changes: 4 additions & 4 deletions 13-js-api-pygments/ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Env {

// Type definition for the Python RPC service methods
interface HighlighterRpcService {
highlight_code(code: string, language?: string): Promise<Map<string, string>>;
highlight_code(code: string, language?: string): Promise<{ [key: string]: string }>;
}

export default {
Expand Down Expand Up @@ -38,9 +38,9 @@ console.log(\`Welcome, \${user.name}!\`);

// Build the HTML page from template
const html = templateHtml
.replace('{{CSS}}', result.get('css') || '')
.replace('{{LANGUAGE}}', result.get('language') || 'unknown')
.replace('{{HIGHLIGHTED_CODE}}', result.get('html') || '');
.replace('{{CSS}}', result['css'] || '')
.replace('{{LANGUAGE}}', result['language'] || 'unknown')
.replace('{{HIGHLIGHTED_CODE}}', result['html'] || '');

return new Response(html, {
headers: { 'Content-Type': 'text/html' },
Expand Down
Loading
Loading