From a48dcb0bb5444fe55531cdf2c9a57a7140ed3dde Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Tue, 7 Oct 2025 13:11:12 +0100 Subject: [PATCH] encode_iri_paths --- rslib/src/scheduler/service/mod.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rslib/src/scheduler/service/mod.rs b/rslib/src/scheduler/service/mod.rs index 160ff8ba4..1bcc35b68 100644 --- a/rslib/src/scheduler/service/mod.rs +++ b/rslib/src/scheduler/service/mod.rs @@ -34,6 +34,7 @@ use crate::scheduler::states::CardState; use crate::scheduler::states::SchedulingStates; use crate::search::SortMode; use crate::stats::studied_today; +use crate::text::encode_iri_paths; impl crate::services::SchedulerService for Collection { /// This behaves like _updateCutoff() in older code - it also unburies at @@ -409,11 +410,17 @@ impl crate::services::SchedulerService for Collection { }) .collect(); + let prepare_card_text_for_display = |html: &str| { + let html = [style.clone(), html.to_string()].concat(); + let html = encode_iri_paths(&html).to_string(); + html + }; + Ok(NextCardDataResponse { next_card: Some(NextCardData { queue: Some(queue.into()), - front: [style.clone(), render.question().to_string()].concat(), - back: [style, render.answer().to_string()].concat(), + front: prepare_card_text_for_display(&render.question()), + back: prepare_card_text_for_display(&render.answer()), answer_buttons, }),