-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Expose cloze text as HTML attribute on question side #1968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c4358dc to
bcb60bb
Compare
bff96bf to
d3e14ff
Compare
to match Python's html.escape and pass tests.
04c3f5d to
6d72f7c
Compare
to make it more generic.
|
Perhaps it could be useful to expose the hint as <span class="cloze" data-cloze="hidden text" data-hint="hint"></span>A disadvantage of this approach is that pseudo-elements are not selectable since they're not part of the DOM. |
|
No objections to adding hint as well, though let's avoid pseudo elements for now. |
9b98020 to
9785c36
Compare
|
Considering the hint is available as the innerHTML of a cloze anyway, I think I'll hold back on adding it as an attribute until a proper cloze overhaul is in the works. If the attribute isn't used by Anki itself (i.e. as pseudo-element content), it is redundant. |
|
Sounds good. Thanks Matthias! |
|
Thanks @kleinerpirat for the implementation! Can hardly wait for the update to reach me. Added another idea to my suggestion in our last chat to expand the 'Cloze', which certainly has many practical applications. Would be very happy if these could be incorporated as well. Although this rather requires a revision of the backend. Proposal: A text cloze should be able to be assigned to several groups. Template: Cards: |
|
To follow up with an additional suggestion that should be easy to implement with few maintenance issues: increase the meta data to allow easier addon creation:
So something like this It would be easy enough to make such a PR if there is an indication of it being welcome? |
|
I'd be fine with accepting such a PR. |
Exposes clozed text as a data-attribute on the front side.
Use case: https://forums.ankiweb.net/t/an-improved-implementation-of-cloze-to-enable-sequential-uncovering/21489/6
Example
Input:
Output with current implementation:
After this PR: