sometimes ctrl+shift+v strips too little (in older Anki verisons), sometimes ctrl+shift+v strips too much (like linebreaks (still relevant in Anki 23.10)), sometimes ctrl+v keeps too much formatting. Maybe in some of these cases this add-on is useful.
This add-on does NOT change how ctrl+v/ctrl+shift+v or "Paste" from the context menu work. This add-on adds a shortcut you can configure (default "Ctrl+Meta/Win+v") and the option "Paste as Plain Text" to the editor context menu.
But this will not solve all paste problems. Try it out. If it doesn't do what you like delete it.
This add-on only affects what's in your clipboard. It doesn't affect the rest of the editor. So if you paste into some text that's formatted the inserted text will "inherit" the same formatting. To put unformatted text into a formatted region maybe have a look at the add-on extended (table) editor. The add-on editor - remove more formatting for selection (headings, hyperlinks, ...) might also be relevant.
The meaning of ctrl+v/ctrl+shift+v has changed over the lifetime of 2.1:
- 2.1.16 or earlier: ctrl+v strips most formatting, ctrl+shift+v keeps more formatting
- 2.1.17 and 2.1.28: ctrl+v keeps most formatting, ctrl+shift+v removes more formatting. The meaning was inversed. see this commit
- 2.1.19 or later introduced an option in the config: "Paste without shift key strips formatting". Default is off, so the behavior is as in 2.1.16 or earlier, see this commit.
In the following screenshot from 2020 I pasted a list that I copied from the description of another popular add-on . I pasted it three times (from top to bottom):
- Anki built-in: stripped formatting
- Anki built-in: keeps more formatting
- my add-on "Paste as Plain Text" from the context menu. Instead of a html list the list entries are indented with four spaces.
# Versions
- 2023-11-05 fix button
- 2023-11-03 fix for qt6 (needed since Anki 23.10)
- 2020-11-08 don't insert nbsp;s
- 2020-02-28 minor updates: default shortcut, optional button, ...
- 2019-09-05 initial release