message-format-wg icon indicating copy to clipboard operation
message-format-wg copied to clipboard

[FEEDBACK] Unpaired bidi isolates should not be a parse error

Open eemeli opened this issue 1 year ago • 1 comments

An observation from implementing bidi isolation as proposed in #781, but which also applies to the currently proposed design for bidi usability:

Requiring the pairing of open-isolate and close-isolate sets up developers to get parse errors for missing or required invisible characters.

As currently proposed, the following message would result in a parse error as it includes an unpaired PDI immediately before the }:

Hello {$world⁩}

In many editors (such as this very form) the LRI/RLI/FSI/PDI characters are not displayed, and are invisibly skipped when moving past them with left/right arrow keys.

This is a setup for developers having a really bad time with MF2; if they start with a message that includes invisible-to-them isolating characters and apply some changes, it's entirely possible that they end up with a message as above, which looks right, but for which a parser complains.

To avoid this, we should not consider missing isolate characters to be a parse error. It should be something for a linter to complain about, but at formatting runtime we should ignore the issue.

eemeli avatar May 13 '24 08:05 eemeli

This is a good callout. I can modify my design as well, but will wait to merge #781 first.

aphillips avatar May 13 '24 15:05 aphillips