Update reviewer.py to prevent custom scheduler js from commenting out py code (#3795)

* Update reviewer.py to prevent custom scheduler js from commenting out py code

* Do not use custom code, but move {js} instead
This commit is contained in:
GithubAnon0000 2025-02-09 13:06:49 +00:00 committed by GitHub
parent 01c4b48c7d
commit 44e01ea063
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1215,7 +1215,11 @@ timerStopped = false;
setFlag = set_flag_on_current_card setFlag = set_flag_on_current_card
# if the last element is a comment, then the RUN_STATE_MUTATION code
# breaks due to the comment wrongly commenting out python code.
# To prevent this we put the js code on a separate line
RUN_STATE_MUTATION = """ RUN_STATE_MUTATION = """
anki.mutateNextCardStates('{key}', async (states, customData, ctx) => {{ {js} }}) anki.mutateNextCardStates('{key}', async (states, customData, ctx) => {{
.finally(() => bridgeCommand('statesMutated')); {js}
}}).finally(() => bridgeCommand('statesMutated'));
""" """