Edit-Field-During-Review-Cloze
Edit-Field-During-Review-Cloze copied to clipboard
Editing changes font size, color, and image width
Hello! I'd first like to say thank you for this wonderful addon; it has been very helpful for my Anki workflow. However, I have noticed that sometimes, when I use this addon, it changes the font-size
and color
of the text in the edited fields, and it also changes the width of the edited fields. So for example, I had an AnKingOverhaul note type where the Extra field looked like this:
<div><i>Do not give to patients with <b>renal disease!</b></i><br></div>
<img src="dang%20(1).png" class="resizer">
<div><div>
<div><img src="paste-517715357860343.jpg" class="resizer" ></div>
<div><img src="paste-9d86051bbf3f953f6d8cb8ee0033c71e3cd48543.jpg" class="resizer"><br></div>
</div></div>
But after I clicked to edit it, it changed to this, even though I ended up not making any intentional edits:
<div><i style="color: navy; font-size: 1rem;">Do not give to patients with <b>renal disease!</b></i><br></div>
<img src="dang%20(1).png" class="resizer" style="width: 431px;">
<div><div>
<div><img src="paste-517715357860343.jpg" class="resizer" style="width: 768px;"></div>
<div><img src="paste-9d86051bbf3f953f6d8cb8ee0033c71e3cd48543.jpg" class="resizer" style="width: 769px;"><br></div>
</div></div>
The key differences are the font-size
and color
styles on the <i>
tag, as well as the width
attribute that was added to all of the images. The new color matches the color that is used to display the card in the reviewer. It doesn't happen every time I edit a card, but it is frequent enough to be mildly annoying to fix it every time. I would appreciate if you could look into this. Alternatively, if you're busy but at least have an idea of what part of the code might be implicated, I could also take a look myself and submit a PR
I'll take a look probably later in the week, but you are welcome to fix it yourself if you want. The width is probably a bug somewhere in the image resizing code (web/resize.js). The added color
and font-size
style I suspect the contenteditable field is making styling inline. If so this might not be fixable but I don't really know for sure.