Skip to content

Allow options on closing markup placeholders #582

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

Merged
merged 3 commits into from
Feb 13, 2024
Merged
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
17 changes: 15 additions & 2 deletions exploration/open-close-placeholders.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ _What context is helpful to understand this proposal?_

- As a CAT tool, I want to use the concepts of open, close, and standalone that I am already familiar with, to provide certain functionalities above.

- As a CAT tool, I want to pair open and close markup even when there are multiple elements of the same type and even when they overlap each other.

- As a developer, I want to connect message markup with existing element instances in the UI.

- As a developer, I want to sanitize translations without removing the markup important to the message.
Expand Down Expand Up @@ -135,7 +137,18 @@ a non-empty sequence of pattern parts (text, placeholders).
Markup spans may be nested,
as in `<b>Bold and <i>also italic</i></b>`.

Markup may have localisable options,
Markup placeholders can contain options.

Some option values might require translation themselves.
For example, `Click <a title="Link tooltip">here</a> to continue.`

The meaning of markup options is externally defined.
Some uses might require specific values
such as when used by tools to associate markup values
in pairs: `Click {#a id=a1}here{/a ref=a1} to {#a id=a2}continue{/a ref=a2}`.

> [!NOTE]
> Many markup systems do not use or permit options on close values.
such as `Click <a title="Link tooltip">here</a> to continue`.

As with function options,
Expand Down Expand Up @@ -173,7 +186,7 @@ placeholder = expression / markup
markup = "{" [s] markup-open [s] ["/"] "}"
/ "{" [s] markup-close [s] "}"
markup-open = "#" name *(s option)
markup-close = "/" name
markup-close = "/" name *(s option)
```

This is similar to [Mustache](http://mustache.github.io/mustache.5.html)'s control flow syntax.
Expand Down