diff --git a/rslib/src/text.rs b/rslib/src/text.rs index f4e375347..bb4176861 100644 --- a/rslib/src/text.rs +++ b/rslib/src/text.rs @@ -438,9 +438,9 @@ pub(crate) fn encode_iri_paths(unescaped_html: &str) -> Cow { }) } -/// URI-decode unescaped local paths in HTML fragment. -pub(crate) fn decode_iri_paths(unescaped_html: &str) -> Cow { - transform_html_paths(unescaped_html, |fname| { +/// URI-decode escaped local paths in HTML fragment. +pub(crate) fn decode_iri_paths(escaped_html: &str) -> Cow { + transform_html_paths(escaped_html, |fname| { match PctStr::new(fname) { Ok(s) => s.decode().into(), Err(_e) => { @@ -452,7 +452,7 @@ pub(crate) fn decode_iri_paths(unescaped_html: &str) -> Cow { } /// Apply a transform to local filename references in tags like IMG. -/// Required to display time, as Anki unfortunately stores the references +/// Required at display time, as Anki unfortunately stores the references /// in unencoded form in the database. fn transform_html_paths(html: &str, transform: F) -> Cow where