Formatting does not get stripped upon pasting (bug)

Version ⁨2.1.53 (f6ecddef)⁩
Python 3.9.7 Qt 6.3.0 PyQt 6.3.0
Windows 10

The same problem arises in 2.1.52 qt6, but not 2.1.51 qt6.
All addons disabled.

If I copy text from the editor and then paste it while shift is pressed (‘Paste without shift key strips formatting’ disabled), all formatting is kept.
The same problem happens if I enable ‘Paste without shift key strips formatting’, restart Anki and then try to paste without pressing the shift key.

Pasting text from outside Anki works fine.

1 Like

This was the way earlier Anki versions behaved too - stripping only happens when pasting from external sources, and stripping on internal fields only happened in ~2.1.50-51 due to a Qt bug on Windows.

Wouldn’t it make more sense if formatting was stripped from internal fields too, at least from a user’s perspective? Or would it be difficult to implement?

Also: Anki 2.1.22, 2.1.33 and 2.1.49 all seem to allow stripping when pasting from the editor.
Or are we talking about even older Anki versions?

I was under the impression this was a regression in the Windows toolkit in 2.1.50, but you are right, it appears to have broken earlier than that. Only Windows is affected.

The broken behaviour was not great, since it prevented certain content from being transferred between fields even when not not stripping. The stripping is really targeted at external content that may not be appropriate to place into fields as-is. For content that’s already in Anki, couldn’t you use the remote formatting button instead?

Yes, the only incoveniency is that the remove formatting button does not strip links

Could you elaborate on why you want to take a field with links and paste the content into another field without the links?