Merge pull request #1197 from RumovZ/fix-template-err

Escape HTML in template error message
This commit is contained in:
Damien Elmes 2021-05-26 08:21:41 +10:00 committed by GitHub
commit 400254277b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,7 +260,7 @@ fn template_error_to_anki_error(err: TemplateError, q_side: bool, tr: &I18n) ->
} else {
tr.card_template_rendering_back_side_problem()
};
let details = localized_template_error(tr, err);
let details = htmlescape::encode_minimal(&localized_template_error(tr, err));
let more_info = tr.card_template_rendering_more_info();
let info = format!(
"{}<br>{}<br><a href='{}'>{}</a>",