[Standards] Need sanity check on an example in XEP-0393: Message Styling
sam at samwhited.com
Fri Nov 6 22:07:11 UTC 2020
On Fri, Nov 6, 2020, at 15:59, Tedd Sterr wrote:
> The way you're suggesting requires unbounded lookahead
I've been meaning to send an email about this for ages too, but this
*is* how it works right now. You definitely have to do this with the
current rules (regardless of how this particular situation works). It's
not really a problem in XMPP land though because the server will enforce
a max message length. I would have liked to fix this, but it would have
made it a lot more likely to have false positives and the user
experience isn't as good (which is why I suspect Slack/Watsapp/etc. do
something similar to what I've done). I probably should have put in an
explicit max-span-length though. Either way, it's not likely to be a
problem even if someone sends you tons of messages with 4k (or whatever
the server allows you to send) spans in them. These are small
(relatively) messages, not documents or serialization formats.
We can chat about this in another thread at some point though
> Don't try to be overly clever with the parsing, a lookahead of one
> character should be sufficient to identify directives. (Whether they
> are active and demark spans depends on matching pairs of directives.)
I understand what you're saying and how your parsing rules
work. What I'm trying to figure out is what the text says right now, and
I'm not sure if it matches what you're describing (which is how I've
written some of my implementations before) or what I described in my
original message. I am not trying to decide what would be best or change
the normative text right now.
I *think* your rules violate "and thus may be present between two
other styling directives" which would mean that "***" is valid, but
I'm not sure.
It also may not matter since this isn't likely to be a real situation,
but if I can clarify the rules I'd love to do so.
More information about the Standards