Anki Forums

2.1.45 Release Candidate

A 2.1.45 release candidate is now available: Changes in 2.1.45 - Anki Betas

I think it is stable enough for daily use, but the plan is to hold off on the final release until the end of the month, to give add-on authors a bit more time to catch up. If you encounter any issues, please let us know.

6 Likes

This minor issue is still present:

2 Likes

This a bug? I can’t modify the html body before loading anymore?

Addon debug code example:

from aqt.gui_hooks import webview_will_set_content

def on_webview_will_set_content(web_content: WebContent, context: Optional[Any]) -> None:
    if isinstance(context, Editor):
        showText(web_content.body)

webview_will_set_content.append(on_webview_will_set_content)

This is what comes up in anki (via popup from the showText function in code above) when the editor window loads:


<div id="fields"></div>
<div id="dupes" class="is-inactive">
    <a href="#" onclick="pycmd('dupes');return false;">Show Duplicates</a>
</div>
<div id="cloze-hint"></div>

where is the html body of the editor ??

It’s not a bug. The toolbar is mounted via Svelte now, a JS component library. For more notes on how to work with Svelte, see here, or here for an example add-on. The fields were always generated via JS (or at least as far as I remember).

3 Likes

Already said it as a side note on another thread, but maybe here it’ll be more useful.

I had a crash when starting this release candidate for the first time (macOS Mojave 10.14.6), but it has worked properly since the second attempt, so I don’t really know what happened on the first one.

Maybe it was just a quirk by my laptop, but just in case…

Version: 2.1.45 RC1
OS: Windows 10
Not sure if it is an intended feature or a bug:

Ctrl+Shift+P does not preview the card/note unless one of the note fields is activated (blinking cursor).
Note: Ctrl+N and Ctrl+P still work to navigate up and down the cards/notes (even when a field is not activated)
No add-ons activated

1 Like

It’s great that Anki now has more formatting functionality built-in.

I have run into two problems (that might be just design choices I don’t like).

I tested .45rc1 without add-ons (I held shift during startup) in windows 10 21h1 and the buttons indent/outdent didn’t work for me on regular paragraphs. I can only indent lists. I tried clicking the buttons with and without a text selection.

My problems are:

  • With the power format pack and mini format pack I could also indent regular paragraphs
  • as far as I see there are no shortcuts for indenting/outdenting. This slows me down a lot because these options are now two mouse clicks away.

From years of using MS Word and in Anki the power format pack/mini format pack I’m very accustomed to indent regular paragraphs with “Ctrl+M”.

I think indenting is very useful if you can’t stick to short cards because it allows to visually structure your content.

1 Like

That’s an unfortunate byproduct of the way shortcuts are handled now. @hengiesel any ideas on how we can handle this? Maybe the window could define a shortcut that sends a signal the webview; it should presumably not receive it if the webview captures the shortcut first?

If the shortcut’s free and Word is using it, that sounds good. The reason it won’t indent bare paragraphs is because of concerns about different clients being able to understand each other: Add block formatting options to Editor by hgiesel · Pull Request #1134 · ankitects/anki · GitHub

Card Bugs:

if there is a space as the first charcter of an image name it doesn’t display (can’t find) the image.
e.g. <img src=" image.png">
(i did a search in browse screen with "src=\" " and literally every image from the results doesn’t display)

also, if i try to add a new image with a space (although it does display properly) it becomes <img src="an%20image.png"> (%20 replaces the space), but the image isn’t being referenced properly, as if i run a ‘check media’, it says: Missing: ⁨an%20image.png

There’s a weird bug when adding cards, which makes pinned(frozen?) cards, when adding, revert back to original text after editing and opening a different application without adding the card(not sure if it clears text from non-frozen fields), happens only the first time I do that, doesn’t replicate after the first

It seems to me that the Mini Format Pack shortcut for indenting is Ctrl+Shift+], not Ctrl+M. Additionally, Ctrl+M is minify window on Mac.

1 Like

Are you sure you’re using then newest version. We had a similar issue before, and I cannot recreate it anymore.
If you are, could you tell us in more detail how to reproduce the bug?

i cant seem to get the addon to work. the shell files seem to reference dist a lot, but i dont have that folder; would that be why?

Yup, I believe I’m using the latest version(2.1.45 (60f6fccc))

On opening the editor whilst reviewing, then exiting the editor, the application closes without syncing and does not show any error.
This generally happens after around 5-10 reviews, if not synced(I don’t know the exact number though)

I had this problem with v2.1.43&44 too but it seemed like a problem with my specific computer (I don’t have another computer to check re-occurance, but if I get a hold of one, will try to replicate the same)
The last version where this bug did not occur for me was 2.1.42, I don’t know if the current bug is somehow tied to the problem of mine with 2.1.43/44.

Those are built by web/build.js. You need to run bin/compile.sh. I’ll also add some documentation in the repo.

1 Like

to make sure i didnt mess up something i cloned your addon to my addons21 folder, then set cd to addon folder, then ran bin/compile.sh but nothing is happening; still no dist folder

$ bin/compile.sh
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
bin/compile.sh: line 14:  8903 Killed: 9               yarn --cwd "$DIR/web" build
Was successfully compiled!

maybe i’m missing dependencies? i have yarn and node, do i need anything else?

I have just finished the translations in Simplified Chinese today. Would it be published in 2.1.45 release?

Next build should fix it, thanks.

Yes, they should make it into the next release candidate.

2 Likes

This (very) minor issue is still present: Anki 2.1.45 Beta - #45 by basiskarten

1 Like

If you put this JavaScript-Snippet in the frontside-Code of a card type:

<script>
try {
	onShownHook.push(function () {
	    document.getElementsByClassName("answer")[0].scrollIntoView({block: "center"});
	})
}
catch (err) {
}
</script>

…and then use {{FrontSide}} in the backside-code of the same card type, the review window freezes/does not update when you click on “Show Answer”. JavaScript-console of card displayed for more info:

Demo note that causes this issue:

Edit: Also happens without any addons.