mnemosyne-proj / mnemosyne

Mnemosyne: efficient learning with powerful digital flash-cards.
https://mnemosyne-proj.org/
Other
507 stars 74 forks source link

Leading whitespace on cards is stripped #213

Closed frozencemetery closed 2 years ago

frozencemetery commented 2 years ago

Hi, I'm trying to make some cards that use whitespace for alignment. A simplified version could be something like:

1 2 3
  ^
 this one

However, mnemosyne seems to display the card stripping the leading whitespace - it becomes:

1 2 3
^
this one

I verified that the cards are correctly (i.e., with the requested whitespace) stored in the db, and I can even edit them as such. It seems to be purely a display issue.

I'm running mnemosyne-2.8+ds1-2 from Debian. I did attempt to run from git, but ran into QT errors. Thanks

pbienst commented 2 years ago

You can use the html for non-breaking space:  

frozencemetery commented 2 years ago

Thanks, that seems to work. I'm still left wondering what the logic is for stripping spaces to begin with is, though. The current behavior seems like an accident - cards are stored with the spaces intact, and of course they show in the editor.

That said, I totally understand not wanting to dig into it - I've already given up on that too, so it's not like I'm about to propose a fix either :)

pbienst commented 2 years ago

The logic is that the card text is interpreted as html, and html ignores extra spaces.