mirror of
https://codeberg.org/Tilo-K/diff-highlighter.git
synced 2026-07-03 16:23:02 +00:00
Highlights .diff/.patch files inline — additions green, deletions red, hunk/file headers styled, with toggleable highlight.js syntax highlighting. - MV3, content script gated on text/plain + URL ending in .diff/.patch - Two-phase render: instant diff colors, then chunked idle-time syntax - Popup switches + Alt+D shortcut, persisted in chrome.storage.sync, live re-render - Light/dark via prefers-color-scheme; only the `storage` permission - TypeScript + esbuild build; Forgejo Actions CI (typecheck + build) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
818 B
Diff
36 lines
818 B
Diff
diff --git a/src/greet.ts b/src/greet.ts
|
|
index 1a2b3c4..5d6e7f8 100644
|
|
--- a/src/greet.ts
|
|
+++ b/src/greet.ts
|
|
@@ -1,8 +1,9 @@
|
|
// Greeting helpers
|
|
-export function greet(name) {
|
|
- return "Hello " + name;
|
|
+export function greet(name: string): string {
|
|
+ const trimmed = name.trim();
|
|
+ return `Hello, ${trimmed || "world"}!`;
|
|
}
|
|
|
|
-console.log(greet("there"));
|
|
+console.log(greet(" there "));
|
|
diff --git a/scripts/run.py b/scripts/run.py
|
|
index aaaaaaa..bbbbbbb 100644
|
|
--- a/scripts/run.py
|
|
+++ b/scripts/run.py
|
|
@@ -1,4 +1,5 @@
|
|
import sys
|
|
|
|
-def main():
|
|
- print("hi")
|
|
+def main() -> int:
|
|
+ print("hello from python")
|
|
+ return 0
|
|
diff --git a/README.md b/README.md
|
|
new file mode 100644
|
|
index 0000000..ccccccc
|
|
--- /dev/null
|
|
+++ b/README.md
|
|
@@ -0,0 +1,2 @@
|
|
+# Demo
|
|
+A tiny sample used to exercise the highlighter.
|