-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Cloze detection broken for multi-line cloze inside html tag #5421
Comments
interesting! great report This issue should be focused on "the close identification regexp seems to be different on AnkiDroid than Anki Desktop" The python code they're using in Anki Desktop should be examined and whatever part makes it work multiline should be brought in to here This should be a great first issue since Anki Desktop (code available here https://github.com/dae/anki/) is so easy to inspect |
thanks by the way for confirming this in the beta so we know it is a current issue - that would have been one of my first requests :-) |
Leonard, if you are interested in digging into this, it's a good first
issue. If you aren't, let me know--I was just in this code and I can
probably hammer this out in a few minutes since you have a great test case.
…On Sat, Aug 31, 2019, 9:24 AM Mike Hardy ***@***.***> wrote:
thanks by the way for confirming this in the beta so we know it is a
current issue - that would have been one of my first requests :-)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5421?email_source=notifications&email_token=AAAIWYKSKGC5UCFCHU6CLQLQHJ5JFA5CNFSM4ISTHQGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5TNW2I#issuecomment-526834537>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAIWYKKJ5E7KA2KPPU26B3QHJ5JFANCNFSM4ISTHQGA>
.
|
@mikehardy Both the AnkiDroid and Anki regexes seem the same and explicitly enable matching new-lines via the
The buggy behaviour only occurs when wrapping the cloze in @adamwolf I don't have an Android dev setup ready to verify any changes, so it would be appreciated if you could go ahead ;) Thanks for taking care of it! |
I'm out this weekend for a US holiday but I will be back at it early next
week.
…On Sat, Aug 31, 2019, 1:41 PM Leonard Lausen ***@***.***> wrote:
@mikehardy <https://github.com/mikehardy> Both the AnkiDroid and Anki
regexes seem the same and explicitly enable matching new-lines via the
(?s) inline flag.
https://github.com/dae/anki/blob/8a2a4d827f1afcab746585ede2ac08833d679757/anki/template/template.py#L7
https://github.com/ankidroid/Anki-Android/blob/95087f50410ff58fe5a8e914ca6462b53b74fe53/AnkiDroid/src/main/java/com/ichi2/libanki/template/Template.java#L48
The buggy behaviour only occurs when wrapping the cloze in <p></p> tags.
@adamwolf <https://github.com/adamwolf> I don't have an Android dev setup
ready to verify any changes, so it would be appreciated if you could go
ahead ;) Thanks for taking care of it!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5421?email_source=notifications&email_token=AAAIWYKFCT72YK2XMRZZPVLQHK3OJA5CNFSM4ISTHQGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5TS5TI#issuecomment-526855885>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAIWYM4LIGN3NVYRI4BQL3QHK3OJANCNFSM4ISTHQGA>
.
|
(I'm a few minutes into this, adding some tests, and... we have at least a few bugs here, folks!) Thanks @leezu. Good catch! |
Can someone confirm this is fixed in the latest betas? |
It's fixed, thank you! |
Reproduction Steps
Note the difference to
or
Expected Result
All 3 notes should show up as
Cloze with [...]
.Actual Result
The
<p>Cloze in html tag with {{c1::multi-line string}}</p>
note does not show up correctly.Instead
Edit this note and add some cloze deletions. (help)
is displayed.After clicking "Edit note" on AnkiDroid without making any changes to the note, the note is displayed correctly.
Checking on Anki Desktop, it turns out that clicking Edit note on AnkiDroid changed the html of the note to:
Debug info
AnkiDroid Version = 2.9beta7
Android Version = 10
ACRA UUID = b8969252-15d5-4075-92a1-81871187ab4b
Research
Enter an [ x ] character to confirm the points below:
[X] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
[X] I have checked the manual and the FAQ and could not find a solution to my issue
[X] I have searched for similar existing issues here and on the user forum
The text was updated successfully, but these errors were encountered: