-
-
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
Problems with text attributes in newly created lines #4562
Comments
We talked briefly with @scofalik and it seems that the listener which clears the element attributes (they can be recognised by the It should be fairly simple – it needs to listen to insert and move operations and just clear attributes of an element to which insertion happens. It doesn't even need to check if it's empty or not – if, by any coincidence the attributes weren't cleared before they can be cleared now. |
This point means a bit more work than I thought because other features which override the enter behaviour need to do this as well. This will require tests in heading, list and blockquote. |
Next minute, next thought – this is even more tricky. The So, we need some... schema configuration? Or link feature changing the behaviour of the enter command? Or an extensible |
BTW, I'm not sure whether we should copy attributes to new lines at all. At least not the semantical ones. From the content semantics perspective, if you press enter you start a new block and a new thought. Why continuing e.g. bold? Just like – why continuing a link? So, I'd vote for not implementing this feature until we need to support font colors, sizes, etc. This would mean that for now we need to only fix this bit:
|
Agree. This is not totally critical and can be left like this for the first release, although it would be nice to have. I would not wait too much for this though. It should be dealt as soon as the critical stuff is closed, imho. |
As for how to differentiate between attributes which need to be copied and these which shouldn't, I'd make this controlled by the schema. This will leave it configurable for the end developers (and I think that it was requested in the past that this behaviour is configurable) and will allow implementing the entire behaviour in one place. |
I moved the engine part to https://github.com/ckeditor/ckeditor5-engine/issues/1001 because it's a bug and should be fixed now. |
For me, as far as user experience goes, I'd certainly expect that bold and italic are retained after creating new paragraph. If I'd see they are not, I'd think it's a bug. So I am of opinion that we will have to do it sooner or later. |
I thought the same initially. But then I started thinking – am I just used to that or is it really needed? MS Word, GDocs and other editors implement this behaviour because in most of them the visual aspect of the content (the styling) is equally important as the content itself. That's WYSIWYG stuff. CKEditor 5 is not meant to be a WYSIWYG. We're always thinking about the semantics. And I can't think of a reason why you'd like to continue styles like bold and link in a new paragraph. Once we'll implement styling options like font color or size, the story will be different. But for now, with the options that we have, I don't see why these styles should be continued. |
DUP in #919 And there's a bit different type of issue in the ckeditor5-alignment pkg: https://github.com/ckeditor/ckeditor5-alignment/issues/8 |
DUP in #1222. |
We're discussing a mechanism for describing whether attributes convey styling or formatting in #908. |
There are two attributes today which shouldn't be copied to a new line: However, we need to take 3rd party plugins into consideration so we cannot hardcode this. I'd, therefore, use a new attr prop called e.g. |
@Reinmar what's an expected behaviour of such cases? Right now I have solution which copy styles regardless of previous block. Should styles from blockquotes, lists, heading be preserved when user leave given block? I saw that google docs clear styles for heading, however lists and block quotes styles remain untouched. |
I've noticed one thing during work on this issue. There is a slight inconsistency with the behaviour of Current stateFor situation when there is collapsed selection at the end of a line. EnterWhen Enter key is pressed then no styles are copied to a new line. Shift + EnterWhen Shift+Enter is pressed then all styles are copied to a new line. Introducing
|
Feature: Add support for `copyOnEnter` attribute's parameter. Closes #40.
You can see a couple of things which got wrong here:
So, things to fix:
👍 if you want this issue to be fixed
The text was updated successfully, but these errors were encountered: