anki icon indicating copy to clipboard operation
anki copied to clipboard

Anki screws up formatting using `[...]` and `[...]+` buttons

Open badlydrawnrob opened this issue 1 year ago • 0 comments

Update January 2025: Still doesn't seem to be resolved

This problem is especially annoying when using cloze deletions with rendered Markdown code blocks:

  1. Cloze tags that wrap text to the end of a line:
    • Tends to "pop" the cloze contents outside of it's parent <span> tag
    • This breaks the Markdown code block's formatting
  2. Multi-line select within a cloze can break the font-family styling
    • And doesn't always look good on hide/reveal

This makes it harder to do some nice things with the code blocks and keep formatting within fenced code blocks. It isn't an easy fix on their side (the Anki devs) either.

I've logged a couple of complaints, but don't see this being resolved anytime soon. The Cloze deletions general purpose was, for instance, hiding a verb within a sentence, so our use here is outside of it's core goal.

Fix suggestions

  1. Select "Rich Text" view and write cloze deletion tags manually
    • This seems safer than using the buttons.
  2. Select up-to but not including the last character per line
    • Then go into code view and move the }} brackets to after the last character on that line
    • But within it's parent line <span> tag
  3. Use ONE cloze deletion per line
    • Sometimes "blocks" (multi-line) cloze deletions work ...
    • But sometimes they completely break formatting of your Markdown code blocks 😔
  4. Or, for guaranteed safety, use the Missing! card for one-liners only
    • And try to have cloze tags within the line, but not up to the end of the line.
    • That sucks and is limiting I know.
Image Image

https://github.com/badlydrawnrob/anki/assets/1176875/39b57600-fa2d-4940-82db-23f6f6674766

badlydrawnrob avatar Feb 03 '24 20:02 badlydrawnrob