Code Wrapper is a simple Anki add-on that adds a toolbar button and keyboard shortcut (Ctrl+Alt+C) to the card editor. It wraps the selected text in <code> tags and replaces newlines with <br>, making it easier to add formatted code to flashcards.
Code is licensed under the MIT License.
- Adds a
<>button to the editor toolbar; - Use Ctrl+Alt+C as a shortcut for quick formatting;
- Automatically escapes special characters and preserves whitespace and line breaks.
You can install the add-on from AnkiWeb (search for "Code Wrapper") or manually by placing it in your addons21 folder (located in %APPDATA%\Anki2\addons21 on Windows, ~/Library/Application Support/Anki2/addons21 on macOS, or ~/.local/share/Anki2/addons21 on Linux).
If you have issues or suggestions, feel free to open an issue or pull request.