From 39cc13885ebf76648620939106149e3d99bfb49c Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Tue, 21 Feb 2023 09:16:40 -0800 Subject: [PATCH 1/3] Define new error "Unknown Markup" From a discussion about the ABNF with @eemeli I noticed that we don't have an error for when `markup` is not recognized. Proposing a fix. --- spec/formatting.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/formatting.md b/spec/formatting.md index a0fcf9a90e..3494e1c689 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -121,6 +121,19 @@ These are divided into the following categories: when * {The value is not one.} ``` + - **Unknown Markup errors** occur when an Expression includes + a reference to a markup handler which cannot be resolved. + + For example, attempting to format the following messages + MUST result in an Unknown Markup error if done within a context that + does not provide a handler for the markup `{+foo}` or `{-foo}` + + ``` + {There are {+foo option=bar}no{-foo} wildebeest here} + {There are {+foo option=bar}no wildebeest here} + {There are no{-foo} wildebeest here} + ``` + - **Selection errors** occur when message selection fails. - **Selector errors** are failures in the matching of a key to a specific selector. From e6f93fe5b30eaf18742244e22856349b309e7d8e Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Wed, 22 Feb 2023 07:49:30 -0800 Subject: [PATCH 2/3] Update spec/formatting.md Co-authored-by: Eemeli Aro --- spec/formatting.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/formatting.md b/spec/formatting.md index 3494e1c689..4bdf92c6c8 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -130,7 +130,13 @@ These are divided into the following categories: ``` {There are {+foo option=bar}no{-foo} wildebeest here} + ``` + + ``` {There are {+foo option=bar}no wildebeest here} + ``` + + ``` {There are no{-foo} wildebeest here} ``` From 3466d33fd656af82b8a68d093cefce48af91e86a Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Wed, 22 Feb 2023 07:49:47 -0800 Subject: [PATCH 3/3] Update spec/formatting.md Co-authored-by: Eemeli Aro --- spec/formatting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/formatting.md b/spec/formatting.md index 4bdf92c6c8..66ba312063 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -126,7 +126,7 @@ These are divided into the following categories: For example, attempting to format the following messages MUST result in an Unknown Markup error if done within a context that - does not provide a handler for the markup `{+foo}` or `{-foo}` + does not provide a handler for the markup `+foo` or `-foo` ``` {There are {+foo option=bar}no{-foo} wildebeest here}