mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix markdown escaping in search errors
This commit is contained in:
parent
2078a094f4
commit
e033f21767
1 changed files with 8 additions and 8 deletions
|
@ -139,20 +139,20 @@ impl AnkiError {
|
||||||
SearchErrorKind::UnknownEscape(ctx) => i18n
|
SearchErrorKind::UnknownEscape(ctx) => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchUnknownEscape,
|
TR::SearchUnknownEscape,
|
||||||
tr_strs!["val"=>(htmlescape::encode_minimal(ctx))],
|
tr_strs!["val"=>(ctx.replace('`', "'"))],
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidState(state) => i18n
|
SearchErrorKind::InvalidState(state) => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchInvalidArgument,
|
TR::SearchInvalidArgument,
|
||||||
tr_strs!("term" => "is:", "argument" => state),
|
tr_strs!("term" => "is:", "argument" => state.replace('`', "'")),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidFlag => i18n.tr(TR::SearchInvalidFlag),
|
SearchErrorKind::InvalidFlag => i18n.tr(TR::SearchInvalidFlag),
|
||||||
SearchErrorKind::InvalidPropProperty(prop) => i18n
|
SearchErrorKind::InvalidPropProperty(prop) => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchInvalidArgument,
|
TR::SearchInvalidArgument,
|
||||||
tr_strs!("term" => "prop:", "argument" => prop),
|
tr_strs!("term" => "prop:", "argument" => prop.replace('`', "'")),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidPropOperator(ctx) => i18n
|
SearchErrorKind::InvalidPropOperator(ctx) => i18n
|
||||||
|
@ -164,31 +164,31 @@ impl AnkiError {
|
||||||
SearchErrorKind::InvalidNumber { provided, context } => i18n
|
SearchErrorKind::InvalidNumber { provided, context } => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchInvalidNumber,
|
TR::SearchInvalidNumber,
|
||||||
tr_strs!["provided"=>provided, "context"=>context],
|
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidWholeNumber { provided, context } => i18n
|
SearchErrorKind::InvalidWholeNumber { provided, context } => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchInvalidWholeNumber,
|
TR::SearchInvalidWholeNumber,
|
||||||
tr_strs!["provided"=>provided, "context"=>context],
|
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidPositiveWholeNumber { provided, context } => i18n
|
SearchErrorKind::InvalidPositiveWholeNumber { provided, context } => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchInvalidPositiveWholeNumber,
|
TR::SearchInvalidPositiveWholeNumber,
|
||||||
tr_strs!["provided"=>provided, "context"=>context],
|
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidNegativeWholeNumber { provided, context } => i18n
|
SearchErrorKind::InvalidNegativeWholeNumber { provided, context } => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchInvalidNegativeWholeNumber,
|
TR::SearchInvalidNegativeWholeNumber,
|
||||||
tr_strs!["provided"=>provided, "context"=>context],
|
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidAnswerButton { provided, context } => i18n
|
SearchErrorKind::InvalidAnswerButton { provided, context } => i18n
|
||||||
.trn(
|
.trn(
|
||||||
TR::SearchInvalidAnswerButton,
|
TR::SearchInvalidAnswerButton,
|
||||||
tr_strs!["provided"=>provided, "context"=>context],
|
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue