
This will make the deck description look a lot saner when markdown handling is enabled.
I’m not a developer. Github says suggestions come here ![]()

This will make the deck description look a lot saner when markdown handling is enabled.
I’m not a developer. Github says suggestions come here ![]()
white-space: pre-wrap;
is necessary if “Anki 2.1.41+ handling” ist turned off (default). Without it, the text would be displayed incorrectly. E.g. without this css style, this:
# Hello
1. World
2. World
3. World
becomes: # Hello 1. World 2. World 3. World.
Not sure how to solve this with css, though.
Ohh I see! It’ll probably stay like this for a long while then before they get to this. I guess I’ll just convert my markdown desc (which looks crazy right now as it has lists and sublists) to HTML.
If the checkbox is enabled, then the markdown gets converted to html. Sure, you could use html directly without enabling that checkbox. But you’d see exactly the same issue as with md.
aw shucks, thanks for the heads-up. so as of now there’s no way to get nice clickable links and multiple paragraphs simultaneously without extra whitespace.
At this point I feel like pre-wrap should just be removed. Before 2.1.41? Require HTML (a warning in the desc edit box should suffice). After? Optional markdown.
Even with markdown enabled, the above issue I described is still present if the text is plain text. E.g. insert this into the description box, while the checkbox is active:
Hello World
Hi
If you remove white-space: pre-wrap;, then it won’t be displayed correctly either. Thus, we cannot simply remove it.
Here’s the code of that deck description window, btw: anki/qt/aqt/deckdescription.py at main · ankitects/anki · GitHub.
No, that checkbox means that before 2.1.41, only plain text / html was available. After that version (2.1.41+) you were able to use markdown, which internally gets converted to html. The only difference is that with that checkbox enabled, writing markdown is supported. Using markdown is optional, though, thus the checkbox.
that checkbox means that before 2.1.41, only plain text / html was available. After that version (2.1.41+) you were able to use markdown
This is what I meant too. I don’t think there was misunderstanding there. I meant “require HTML” as in a “warning: you’ll have to use HTML if you want linebreaks” line above the edit box, but if they just need a paragraph then plaintext is fine.
Even with markdown enabled, the above issue I described is still present
This I did not expect! I just assumed the magical conversion would transform the empty lines in markdown into paragraphs. Oops. This problem really is more complex and takes more effort to fix.
I know this doesn’t solve the actual issue, but maybe you are interessted in a hack for your use case. Let’s say you have this md and enable the checkbox:
# Hello
1. World
1. Indented
2. Indented
2. World
3. World
It would get converted to this html (you can see that via the webview addon from your gif):
<ol>
<li>World
<ol>
<li>Indented</li>
<li>Indented</li>
</ol>
</li>
<li>World</li>
<li>World</li>
</ol>
You could take this and put it into a div and revert the css:
<div style="
white-space: normal;
">
<ol>
<li>World
<ol>
<li>Indented</li>
<li>Indented</li>
</ol>
</li>
<li>World</li>
<li>World</li>
</ol>
</div>
Inputting this, while having the checkbox disabled, will solve your issue.
Yes thank you!! I was actually just looking at overview.css and wondering if I should modify that for myself and whether that would work at all because that’s in the …/cache/… folder (very obvious I know nothing about developing haha). Your solution makes so much sense.
Hi I just found out it didn’t work on AnkiDroid, so I’m leaving this suggestion post up without marking a solution. Hopefully when contributors have time for aesthetics they’ll remember this legacy problem about deck descriptions. ![]()