Closed du5tmd closed 9 months ago
Anki Desktop
AnkiDroid 2.18alpha ea9e966ee6d260c9afbd2458569ca9a2d00856be
02:18:55.059 AbstractFlashcardViewer I AbstractFlashcardViewer:: Show answer button pressed
02:18:55.059 AutomaticAnswer I stop: automatically show answer
02:18:55.059 Reviewer D Fullscreen delayed hide in 100ms
02:18:55.060 AbstractFlashcardViewer D displayCardAnswer()
02:18:55.097 TypeAnswer D correct answer = null
02:18:55.097 D user answer =
02:18:55.101 AbstractFlashcardViewer D updateCard()
02:18:55.101 SoundPlayer I loading sounds for card 1655468925456
02:18:55.115 AbstractFlashcardViewer D fillFlashcard()
02:18:55.117 AbstractFlashcar...gGestureDetector D Removing pending touch events for gestures
02:18:55.117 SoundPlayer$playAllSoundsForSide I playing sounds for ANSWER
02:18:55.173 chromium I [INFO:CONSOLE(837)] "Uncaught (in promise) ReferenceError: showHintsForPseudoClozes is not defined", source: http://127.0.0.1:32857/ (837)
02:18:55.179 I [INFO:CONSOLE(837)] "Uncaught ReferenceError: showHintsForPseudoClozes is not defined", source: http://127.0.0.1:32857/ (837)
02:18:55.443 Stopwatch D executed page render in 270ms
02:18:55.443 AbstractFlashcar...dViewerWebClient D Java onPageFinished triggered: data:text/html;charset=utf-8;base64,
02:18:55.488 rsdroid::logging D STDOUT: [INFO:CONSOLE(837)] "Uncaught (in promise) ReferenceError: showHintsForPseudoClozes is not defined", source: http://127.0.0.1:32857/ (837)
02:18:55.488 D STDOUT: [INFO:CONSOLE(837)] "Uncaught ReferenceError: showHintsForPseudoClozes is not defined", source: http://127.0.0.1:32857/ (837)
@du5tmd Thank you! Got it from here
@BrayanDSO parseSourcesToFileScheme
strips <script>
tags if a substitution takes place.
Introduced: 2.17.3
Cause:
This isn't an exact test case (the output should be changed due to the substitution), but it demonstrates the problem
Index: AnkiDroid/src/test/java/com/ichi2/libanki/TemplateManagerTest.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/test/java/com/ichi2/libanki/TemplateManagerTest.kt b/AnkiDroid/src/test/java/com/ichi2/libanki/TemplateManagerTest.kt
--- a/AnkiDroid/src/test/java/com/ichi2/libanki/TemplateManagerTest.kt (revision 8b4245f8ec407cd1c493eb75ddf2c1226230b3f4)
+++ b/AnkiDroid/src/test/java/com/ichi2/libanki/TemplateManagerTest.kt (date 1709607117290)
@@ -133,6 +133,48 @@
assertEquals("""<img src="file:///storage/emulated/0/AnkiDroid@%23$%25/collection.media/magenta.png">""", result)
}
+
+
+ @Test
+ fun `parseSourcesToFileScheme - mixed script`() {
+ val input = """
+ <!-- VERSION 1.14 -->
+ <script>
+ var scrollToClozeOnToggle = false
+ var animateScroll = true
+ var showHintsForPseudoClozes = true
+ var underlineRevealedPseudoClozes = false
+ var underlineRevealedGenuineClozes = true
+ var revealPseudoClozesByDefault = false
+ var swapLeftAndRightBorderActions = false
+
+ // Shortcut options
+ var revealNextGenuineClozeShortcut = "W"
+ var revealAllGenuineClozesShortcut = "Shift+W"
+
+ var revealNextPseudoClozeShortcut = "Q"
+ var revealAllPseudoClozesShortcut = "Shift+Q"
+
+ // Touch open ("genuine" or "pseudo")
+ var leftTouchOpen = "genuine"
+ var rightTouchOpen = "genuine"
+ </script>
+
+ <div id="extra-section">
+
+ <div id="extra" class="content" style="display:none">
+ • type 1 RTA (distal): Sx: nephrocalcinosis, renal stone Hx<br><img src="paste-0f5d2bfd133325a24eb52012f66c8887ef5d79b7.jpg" width="203"> <img src="https://www.researchgate.net/publication/258205248/figure/fig1/AS:202727771643906@1425345475421/Ultrasound-of-the-right-kidney-shows-marked-medullary-nephrocalcinosis-The-kidney-is.png" width="193"><br><br>• ECG<br><br><img alt="Hyperkalaemia ECG changes • LITFL • ECG Library" src="PushPull-K-ECG.png" width="500">
+ </div>
+ </div>
+
+ <!-- ENHANCED_CLOZE -->
+ <span id="enhanced-cloze-content" style="display:none">저칼륨혈증 <font size="1">Hypokalemia</font><br>• 정의: plasma K {{c1::< 3.5}}<br>• 증상: {{c1::피로, 근육통, 힘빠짐, 변비, 장폐색, 부정맥, 다음, 다뇨}}<br>• 검사: {{c1::ECG (ST depression)}}<br><br>감별<br>• {{c1::Urine K > 15<br> ∘}} {{c1::Metabolic acidosis:}} {{c1::DKA, RTA(type 1, 2), acetazolamide<br> ∘}} {{c1::Metabolic alkalosis: <br> ▸}} {{c1::BP↑: 고알도스테론(레닌↓), 리들, 신혈관고혈압, 신실질질환, 갈색세포종, ACTH<br> ▸}} {{c1::BP−: 구토, 이뇨제, 바터, 기텔만, 저마그네슘}}<br>• {{c1::Urine K < 15<br> ∘}} {{c1::Acidosis:}} {{c1::설사, 완화제<br> ∘}} {{c1::Alkalosis:}} {{c1::발한}}<br><br>Tx: {{c1::원인제거, 경구 칼륨, KCl IV + N/S<br> ∘ IV KCl: 속도:}} {{c1::≤20meq/L/hr, 농도 ≤40meq/L, 용량 ≤200meq/L/d}}</span>
+ <span style="display:none;" id="edit-clozes">저칼륨혈증 <font size="1">Hypokalemia</font><br>• 정의: plasma K <span class="cloze" data-cloze="&lt; 3.5" data-ordinal="1">[...]</span><br>• 증상: <span class="cloze" data-cloze="피로, 근육통, 힘빠짐, 변비, 장폐색, 부정맥, 다음, 다뇨" data-ordinal="1">[...]</span><br>• 검사: <span class="cloze" data-cloze="ECG (ST depression)" data-ordinal="1">[...]</span><br><br>감별<br>• <span class="cloze" data-cloze="Urine K &gt; 15<br>&nbsp; &nbsp; ∘" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="Metabolic acidosis:" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="DKA, RTA(type 1, 2), acetazolamide<br>&nbsp; &nbsp; ∘" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="Metabolic alkalosis: <br>&nbsp; &nbsp; &nbsp; &nbsp; ▸" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="BP↑: 고알도스테론(레닌↓), 리들, 신혈관고혈압, 신실질질환, 갈색세포종, ACTH<br>&nbsp; &nbsp; &nbsp; &nbsp; ▸" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="BP−: 구토, 이뇨제, 바터, 기텔만, 저마그네슘" data-ordinal="1">[...]</span><br>• <span class="cloze" data-cloze="Urine K &lt; 15<br>&nbsp; &nbsp; ∘" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="Acidosis:" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="설사, 완화제<br>&nbsp; &nbsp; ∘" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="Alkalosis:" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="발한" data-ordinal="1">[...]</span><br><br>Tx: <span class="cloze" data-cloze="원인제거, 경구 칼륨, KCl IV + N/S<br>&nbsp; &nbsp; ∘ IV KCl: 속도:" data-ordinal="1">[...]</span> <span class="cloze" data-cloze="≤20meq/L/hr, 농도 ≤40meq/L, 용량 ≤200meq/L/d" data-ordinal="1">[...]</span></span>
+ """
+ val result = parseSourcesToFileScheme(input, "/storage/emulated/0/15773/collection.media")
+ assertEquals(input, result)
+ }
+
/***********************************************************************************************
* [parseVideos] tests
**********************************************************************************************/
doc.head().html() + doc.body().html()
fixes this case, but the HTML is an inexact replica (the initial comment is stripped).
This may need a different library
bug_note.zip
Checked for duplicates?
What are the steps to reproduce this bug?
Using the addon "Enhanced Cloze 2.1 v2", make a cloze card with images.
Expected behaviour
Clozes should appear.
ex. Name: {{c1::john doe}} Pic: => Name: [...] Pic: (face.jpg)
Actual behaviour
Clozes don't appear at all.
ex. Name: {{c1::john doe}} Pic: => Name: Pic: (face.jpg)
Debug info
(Optional) Anything else you want to share?
No response
Research