From 927a6e7be11fb77fc4a99d88e3a0b738067d5dff Mon Sep 17 00:00:00 2001 From: MorenoTropical <154519856+morenotropical@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:26:49 -0300 Subject: [PATCH] match assets paths with Anki's asked by BrayanDSO --- AnkiDroid/src/main/assets/card_template.html | 6 +++--- .../java/com/ichi2/anki/ViewerResourceHandler.kt | 2 +- .../anki/cardviewer/AndroidCardRenderContext.kt | 4 ++-- .../com/ichi2/anki/previewer/PreviewerHelpers.kt | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/AnkiDroid/src/main/assets/card_template.html b/AnkiDroid/src/main/assets/card_template.html index 1d7c46bda791..7883978d7436 100644 --- a/AnkiDroid/src/main/assets/card_template.html +++ b/AnkiDroid/src/main/assets/card_template.html @@ -8,12 +8,12 @@ - + ::script:: - + - +
diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/ViewerResourceHandler.kt b/AnkiDroid/src/main/java/com/ichi2/anki/ViewerResourceHandler.kt index 5d7c00023dcf..b654e29b787c 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/ViewerResourceHandler.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/ViewerResourceHandler.kt @@ -49,7 +49,7 @@ class ViewerResourceHandler(context: Context) { try { if (path.startsWith(MATHJAX_PATH_PREFIX)) { val mathjaxAssetPath = Paths.get( - "backend/web/vendor/mathjax", + "backend/js/vendor/mathjax", path.removePrefix(MATHJAX_PATH_PREFIX) ).pathString val inputStream = assetManager.open(mathjaxAssetPath) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/AndroidCardRenderContext.kt b/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/AndroidCardRenderContext.kt index 327e08c7f149..46e8262b1ab6 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/AndroidCardRenderContext.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/AndroidCardRenderContext.kt @@ -69,8 +69,8 @@ class AndroidCardRenderContext( val script = when (requiresMathjax) { false -> "" true -> - """ - """ + """ + """ } val cardClass = cardAppearance.getCardClass(ord + 1) + if (requiresMathjax) " mathjax-needs-to-render" else "" diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/previewer/PreviewerHelpers.kt b/AnkiDroid/src/main/java/com/ichi2/anki/previewer/PreviewerHelpers.kt index 91d2a34aed9f..115884aeed21 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/previewer/PreviewerHelpers.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/previewer/PreviewerHelpers.kt @@ -73,8 +73,8 @@ fun stdHtml( AnkiDroid - - + +