Implement Unicode text formatter plugin

- Add unicode-maps.ts with BOLD_MAP, ITALIC_MAP, BOLD_ITALIC_MAP from Unicode Sans-Serif ranges
- Add formatter.ts with transformText(text, style) using the maps
- Add commands.ts registering three editorCallback commands (bold, italic, bold-italic)
- Replace sample plugin boilerplate in main.ts with UnicodeFormatterPlugin wired to registerCommands
- Update manifest.json with correct id, name, and description
- Delete unused settings.ts boilerplate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 19:21:16 +01:00
parent e2954a8795
commit fd74c0987e
6 changed files with 71 additions and 134 deletions
+14
View File
@@ -0,0 +1,14 @@
import { BOLD_MAP, ITALIC_MAP, BOLD_ITALIC_MAP } from "./unicode-maps";
export type FormatStyle = "bold" | "italic" | "bold-italic";
const STYLE_MAPS: Record<FormatStyle, Record<string, string>> = {
"bold": BOLD_MAP,
"italic": ITALIC_MAP,
"bold-italic": BOLD_ITALIC_MAP,
};
export function transformText(text: string, style: FormatStyle): string {
const map = STYLE_MAPS[style];
return [...text].map(ch => map[ch] ?? ch).join("");
}