Modify card rendering output to specify if rendered card is empty #3890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #3889
There currently isn't an easy and accurate way to tell if a rendered card is empty. In rslib, a test checks for the "card is blank" substring, whereas in ankidroid:
This pr proposes to modify the card rendering output to return a flag indicating if the card was empty (missing cloze or empty front), replacing the need for flaky substring matching
Breakage:
They may need to account for the extra field in
RenderCardResponse. Similar to c731c77, ankidroid might have to update https://github.com/ankidroid/Anki-Android/blob/5726c433ba269dbde5a9caa93cac0c0174c0d37b/AnkiDroid/src/main/java/com/ichi2/libanki/TemplateManager.kt#L61 to begin to make use of itc731c77 changes the
PartiallyRenderedCardclass by adding a field. As it stands i'm not sure if this would break any existing addons, but it does not seem likely