-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Behaviour of sub/sup features #5556
Comments
Regarding the order (1) – the current order how e.g. bold and italic are output base, I think, on the alphabetical order (so to be consistent). There's also the concept of priorities of It came to my mind though, that we could use current date as a value of 10 + new Date().getTime() / 10000000000000 ~= 10.1535966907083 A couple of seconds later:
Etc. With every second it gets a higher priority so sub/sups created later get inside (or outside, however it should work) of sub/sups created earlier. I wonder if this may work :D It seems to be a hack but perhaps once we analyse this it may turn out that it's indeed what we need. PS. The only problem is if you have two different |
It won't work for removing (unwrapping) such |
Why? The priority will be the same – it'll be taken from the |
Oh sorry, missed that part. |
As far as creating |
I think that to implement it, we need to add some priority information, most probably also to the model, and then take it into consideration during the conversion. I think, instead of using the timestamp we could check what priorities other elements has and use an incremented value. |
Answering @scofalik. Check out CKEditor 4. When you're in: <p><sub>Foo[Bar]</sub></p> And you:
So, the order of styles is that the style which is applied later ends inside the style applied earlier. |
Answering @pjasiun.
How's that different from using a timestamp? You know the base priority of Sub/Sup. So when you want to decrement/increment, you just need to add whatever to it. |
The difference is not big. I just think it is nicer to use |
Hard to tell whether int priorities are going to work in a longer term. Depending on how we'd use them when applying and removing the styles a couple of time we might quickly end up with priorites like |
I think |
Agreed with @quicksketch, and that'd make this far simpler to implement too! Easy for both end users and the maintainers 👍 |
Related bug: #15117 |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
Still interested in this. |
The ckeditor/ckeditor5-basic-styles#74 PR by @idleb introduces basic subscript and superscript support. However, since it's implemented in the same way than bold/italic/etc it comes with their semantics:
i > strong
). With sub/sup you may want to createsup > sub
orsub > sup
. It simply depends on the semantics of the text and cannot be hardcoded by the editor.sub > sub
orsup > sub > sup
. That won't be doable with how this feature is implemented.In CKEditor 4 the (2) is not possible but (1), the order, is controllable. In CKEditor 5 both are not doable now and while we can ignore (2) I'm afraid about (1). The biggest problem here is that it won't be that small change. Also, regarding (2), I remember that it was requested by the users of CKEditor 4 (IDK how many though).
But, before we'll sink into this, are these limitations important to you? Please 👍 this ticket and leave comments which parts are crucial for you.
The text was updated successfully, but these errors were encountered: