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

Accepted values for NodeAttributes are missing #17953

Open
bburdette opened this issue Feb 18, 2025 · 1 comment
Open

Accepted values for NodeAttributes are missing #17953

bburdette opened this issue Feb 18, 2025 · 1 comment
Labels
squad:core Issue to be handled by the Core team. type:docs This issue reports a task related to documentation (e.g. an idea for a guide).

Comments

@bburdette
Copy link

Origin URL

https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_model_node-NodeAttributes.html

Project version

44.2.0

Is the information outdated? How?

The docs say:

Node's attributes. See toMap for a list of accepted values.

But toMap just documents a function from data[key: string] : T to Map<string, T>. It doesn't specify what values are acceptable for NodeAttributes.

Unless any string is acceptable? NodeAttributes are used this way: writer.createElement( 'paragraph', { alignment: 'center' } ); I was thinking I'd find a list of properties like 'alignment' together with their acceptable values.

Is there something missing in the guide? What is it?

No response

Is there anything else you would like to add?

No response

User agent

Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0

@bburdette bburdette added squad:core Issue to be handled by the Core team. type:docs This issue reports a task related to documentation (e.g. an idea for a guide). labels Feb 18, 2025
@bburdette
Copy link
Author

bburdette commented Feb 19, 2025

Reading the code, the attribs are DOM node attributes, not some special attribs unique to ckeditor. Stuff I put in there ends up in the html. So a list of valid keys would be I guess any HTML Attribute

One other thing, the example writer.createElement( 'paragraph', { alignment: 'center' } ); contains an 'alignment' key, but alignment is not listed as a valid html attrib. That lead me to believe these attribs might be unique to CKEditor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:core Issue to be handled by the Core team. type:docs This issue reports a task related to documentation (e.g. an idea for a guide).
Projects
None yet
Development

No branches or pull requests

1 participant