mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
encode_iri_paths
This commit is contained in:
parent
b80dc25999
commit
a48dcb0bb5
1 changed files with 9 additions and 2 deletions
|
|
@ -34,6 +34,7 @@ use crate::scheduler::states::CardState;
|
||||||
use crate::scheduler::states::SchedulingStates;
|
use crate::scheduler::states::SchedulingStates;
|
||||||
use crate::search::SortMode;
|
use crate::search::SortMode;
|
||||||
use crate::stats::studied_today;
|
use crate::stats::studied_today;
|
||||||
|
use crate::text::encode_iri_paths;
|
||||||
|
|
||||||
impl crate::services::SchedulerService for Collection {
|
impl crate::services::SchedulerService for Collection {
|
||||||
/// This behaves like _updateCutoff() in older code - it also unburies at
|
/// This behaves like _updateCutoff() in older code - it also unburies at
|
||||||
|
|
@ -409,11 +410,17 @@ impl crate::services::SchedulerService for Collection {
|
||||||
})
|
})
|
||||||
.collect();
|
.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 {
|
Ok(NextCardDataResponse {
|
||||||
next_card: Some(NextCardData {
|
next_card: Some(NextCardData {
|
||||||
queue: Some(queue.into()),
|
queue: Some(queue.into()),
|
||||||
front: [style.clone(), render.question().to_string()].concat(),
|
front: prepare_card_text_for_display(&render.question()),
|
||||||
back: [style, render.answer().to_string()].concat(),
|
back: prepare_card_text_for_display(&render.answer()),
|
||||||
|
|
||||||
answer_buttons,
|
answer_buttons,
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue