diff --git a/spec/data-model/README.md b/spec/data-model/README.md index 6be5085f11..0e2b5cd5bd 100644 --- a/spec/data-model/README.md +++ b/spec/data-model/README.md @@ -236,38 +236,20 @@ interface UnsupportedAnnotation { ## Markup -A `Markup` object is either `MarkupOpen`, `MarkupStandalone`, or `MarkupClose`, -which are differentiated by `kind`. +A `Markup` object has a `kind` of either `"open"`, `"standalone"`, or `"close"`, +each corresponding to _open_, _standalone_, and _close_ _markup_. The `name` in these does not include the starting sigils `#` and `/` or the ending sigil `/`. -The optional `options` for open and standalone markup use the same `Option` -as `FunctionAnnotation`. +The optional `options` for markup use the same `Option` as `FunctionAnnotation`. ```ts -type Markup = MarkupOpen | MarkupStandalone | MarkupClose; - -interface MarkupOpen { - type: "markup"; - kind: "open"; - name: string; - options?: Option[]; - attributes?: Attribute[]; -} - -interface MarkupStandalone { +interface Markup { type: "markup"; - kind: "standalone"; + kind: "open" | "standalone" | "close"; name: string; options?: Option[]; attributes?: Attribute[]; } - -interface MarkupClose { - type: "markup"; - kind: "close"; - name: string; - attributes?: Attribute[]; -} ``` ## Extensions diff --git a/spec/data-model/message.dtd b/spec/data-model/message.dtd index c6cb86c324..276b5bb05b 100644 --- a/spec/data-model/message.dtd +++ b/spec/data-model/message.dtd @@ -46,7 +46,6 @@ - Markup-close_** starts with U+002F SOLIDUS `/` and is a _pattern_ part ending a span. -Unlike the other forms, it does not include _options_. ```abnf -markup = "{" [s] markup-open *(s attribute) [s] ["/"] "}" - / "{" [s] markup-close *(s attribute) [s] "}" -markup-open = "#" identifier *(s option) -markup-close = "/" identifier +markup = "{" [s] "#" identifier *(s option) *(s attribute) [s] ["/"] "}" ; open and standalone + / "{" [s] "/" identifier *(s option) *(s attribute) [s] "}" ; close ``` -> A _message_ with one `button` markup span and a standalone `img` markup element. +> A _message_ with one `button` markup span and a standalone `img` markup element: > > ``` > {#button}Submit{/button} or {#img alt=|Cancel| /}.} > ``` +> A _message_ with attributes in the closing tag: +> +> ``` +> {#ansi attr=|bold,italic|}Bold and italic{/ansi attr=|bold|} italic only {/ansi attr=|italic|} no formatting.} +> ``` + A _markup-open_ can appear without a corresponding _markup-close_. A _markup-close_ can appear without a corresponding _markup-open_. _Markup_ _placeholders_ can appear in any order without making the _message_ invalid. @@ -732,7 +735,7 @@ attribute = "@" identifier [[s] "=" [s] (literal / variable)] > A _message_ with _markup_ that should not be copied: > > ``` -> Have a {+span @can-copy}great and wonderful{-span @can-copy} birthday! +> Have a {#span @can-copy}great and wonderful{/span @can-copy} birthday! > ``` ## Other Syntax Elements