Skip to content
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

Add textNode.isEmpty member #3326

Closed
jacekbogdanski opened this issue Aug 9, 2019 · 3 comments · Fixed by #3325
Closed

Add textNode.isEmpty member #3326

jacekbogdanski opened this issue Aug 9, 2019 · 3 comments · Fixed by #3325
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:feature A feature request.
Milestone

Comments

@jacekbogdanski
Copy link
Member

Type of report

Feature request

Provide description of the new feature

The function should check whether the text node is empty or its value is set to CKEDITOR.dom.selection.FOLLOWING_CHAR_SEQUENCE which should be treated as an internal string, not real text node value.

@jacekbogdanski jacekbogdanski added type:feature A feature request. status:confirmed An issue confirmed by the development team. core The issue is caused by the editor core code. labels Aug 9, 2019
@Comandeer
Copy link
Member

I propose adding optional parameter ignoreWhiteSpace to cover one more use-case: https://github.com/ckeditor/ckeditor-dev/blob/64749bb245d1e91f6a4ac4e97c9648ec47acda91/core/dom/element.js#L1021

@jacekbogdanski
Copy link
Member Author

I would avoid passing flag boolean parameters to methods which makes them less obvious to work with. Maybe let's go with additional member isBlank? Seems like a super simple method but much more verbose.

@Comandeer
Copy link
Member

IMO isEmpty and isBlank sounds too similar and I can imagine having trouble with differencing between these two, always checking docs to choose the right one.

@Comandeer Comandeer added this to the 4.13.0 milestone Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:feature A feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants