Re: [w3c/editing] Should we expose physical direction in Deletion commands? (for the case of RTL) (#133)

> If the range start-node and end node are the same and this node is a text node, we know it's character deletion. In all other cases it will be something else, right?

Sounds right.

> Additionally, we should probably add examples of this to the spec to make it clearer to everyone.

Examples are always good.

> The function you are asking for may have more usecases though. Basically it would be about turning a string of unicode characters into an array of graphemes, right? This could be used if, for example, one wants to do grapheme deletion using backspace under all circumstances, even when the browser disagrees.

Yes, probably. At the same time, figuring out whether you're supposed to delete a single character, or the whole grapheme cluster is language dependent (and seems to be dependent of what you want to do with it, as it was earlier mentioned that you may not want to do the same when deleting forward and backward), it looks a bit tricky.

My goal here isn't so much to expose a general purpose text/unicode API allowing you to do all manners of smart things, but to help naïvely programmed editors to deal with international text simply without screwing everything up.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/133#issuecomment-236523621

Received on Monday, 1 August 2016 10:09:43 UTC