message-format-wg
message-format-wg copied to clipboard
Markup: do we need a different sigil for display element names?
Comments migrated from the slides
This is {b}bold{/b} and here's a {a href="http://foo.com"}link{/a}.
Slides comment, Mihai Nita (@mihnita), 1:24 PM Apr 21
This does not follow the syntax as described in the previous slide.
It is not a literal or formatted value or function without parameters.
It looks like it makes html a first class citizen, while any other formats will be second class.
I would rather see this as literals + custom functions. So that from the same string one can generate html, spans (Android), AttributedString (iOS), ANSI escapes (command line)
====
Comments migrated from the slides
Missing standalone? For example {img ... /}
Slides comment, Eemeli Aro (@eemeli), 1:30 PM Apr 21 (edited 1:31 PM Apr 21)
The previous slide describes the syntax for Expressions. This slide describes the syntax for MarkupStart and MarkupEnd. The syntaxes for these are rather intentionally different.
Slides comment, Mihai Nita (@mihnita), 1:36 PM Apr 21
OK... I can go with that for the syntax. But the separation feels somewhat artificial.
This is the same thing, but with open/close/standalone attributes, and fixed function (which I don't quite like).
Why give them special treatment?
Slides comment, Eemeli Aro (@eemeli), 1:40 PM Apr 21
Could you clarify what you mean by "fixed function"? I don't think I quite understand that.
Slides comment, Mihai Nita (@mihnita), 11:50 AM Apr 23
The function that interprets / renders / formats the markup is not specified in this proposal. Which makes it implicit, and fixed (I can't change it, as a developer).
But it can't be just one function, because on might have HTML tags, and text-to-speech tags (SSML). We had this as a requirement from very early on (at least formatting & speech). And might want to generate HTML, Android Spans, macos/iOS AttributedString
This seems to focus on HTML and ignore all else. Which means one can't implement / register a custom formatting.
And it is even less flexible than html.
HTML can use new tags using namespaces. For example the MathML & the SVG namespace.
But this can't, or not cleanly. Because there are conflicts, for example "sub":
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub
- https://cloud.google.com/text-to-speech/docs/ssml#sub
And how does one prevents conflicts with a new markup 2 years from now?
I think we should define one placeholder syntax that allows
- a value (argument name or value literal)
- a function by name
- possibly with syntax indicating open/close as discussed in issue #240
- key=value options
... and carefully define in the registry useful functions that cover known use cases. Certain things could be done by single-purpose functions that need no input value, and other things could be done by functions that could use a value (probably a literal) for different markup or styles etc.
I believe that we've established that this has been resolved with the :/+/- function sigils.
@eemeli I agree this is addressed. Leaving open now to give others time to review.
+1 to close