Skip to content

Change the syntax of the #open and /close function calls #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,14 @@ Between the brackets, the following contents are used:
> Example: `{:platform}`

- Opening _expression_ with no operand:
U+002B PLUS SIGN `+` followed by the _function_ _name_
U+0023 NUMBER SIGN `#` followed by the _function_ _name_

> Example: `{+tag}`
> Example: `{#tag}`

- Closing _expression_ with no operand:
U+002D HYPHEN-MINUS `-` followed by the _function_ _name_
U+002F SOLIDUS `/` followed by the _function_ _name_

> Example: `{-tag}`
> Example: `{/tag}`

- Otherwise: The U+FFFD REPLACEMENT CHARACTER `�` character

Expand Down
2 changes: 1 addition & 1 deletion spec/message.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ annotation = (function *(s option)) / reserved

literal = quoted / unquoted
variable = "$" name
function = (":" / "+" / "-") name
function = (":" / "#" / "/") name
option = name [s] "=" [s] (literal / variable)

; reserved keywords are always lowercase
Expand Down
16 changes: 8 additions & 8 deletions spec/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ plucking the first name from the object representing a person:
A message with two markup-like _functions_, `button` and `link`,
which the runtime can use to construct a document tree structure for a UI framework:

{{+button}Submit{-button} or {+link}cancel{-link}.}
{{#button}Submit{/button} or {#link}cancel{/link}.}

An opening element MAY be present in a message without a corresponding closing element,
and vice versa.
Expand Down Expand Up @@ -356,8 +356,8 @@ other than the _operand_ in front of them.
_Functions_ use one of the following prefix sigils:

- `:` for standalone content
- `+` for starting or opening _expressions_
- `-` for ending or closing _expressions_
- `#` for starting or opening _expressions_
- `/` for ending or closing _expressions_

```abnf
expression = "{" [s] ((operand [s annotation]) / annotation) [s] "}"
Expand Down Expand Up @@ -397,17 +397,17 @@ option = name [s] "=" [s] (literal / variable)
> ```
>
> ```
> {+ssml.emphasis level=strong}
> {#ssml.emphasis level=strong}
> ```
>
> Message examples:
>
> ```
> {This is {+b}bold{-b}.}
> {This is {#b}bold{/b}.}
> ```
>
> ```
> {{+h1 name=above-and-beyond}Above And Beyond{-h1}}
> {{#h1 name=above-and-beyond}Above And Beyond{/h1}}
> ```

#### Reserved
Expand Down Expand Up @@ -485,7 +485,7 @@ unquoted-start = name-start / DIGIT / "."
### Names

The **_name_** token is used for variable names (prefixed with `$`),
function names (prefixed with `:`, `+` or `-`),
function names (prefixed with `:`, `#` or `/`),
as well as option names.
It is based on XML's [Name](https://www.w3.org/TR/xml/#NT-Name),
with the restriction that it MUST NOT start with `:`,
Expand All @@ -494,7 +494,7 @@ Otherwise, the set of characters allowed in names is large.

```abnf
variable = "$" name
function = (":" / "+" / "-") name
function = (":" / "#" / "/") name

name = name-start *name-char
name-start = ALPHA / "_"
Expand Down