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
It's not possible to define HTML attributes without value #4521
Comments
While this is a missing feature (not really a bug), I'd wonder how important it is taken that |
The API might be tricky to do this in a way that is compatible with current design. One idea that comes to my mind is to create a dedicated type/value that would be used for that. Something like this: import EmptyAttribute from 'xyz';
myElement.setAttribute( 'required', EmptyAttribute ); |
I need to be able to set The resulting markup is |
@bbenjamin I tried to reproduce the problem that you're describing but all seems to work fine for me. For instance, I made Paragrap's downcast to look like this:
And the DOM looks good: The data returned by
I also checked that you can have images with empty alt:
Just to be 100% sure, I changed the value of this image's alt by the model writer (ensuring that the entire pipeline from the model to the view works fine):
So, I'm afraid the issue is somewhere outside CKE5's code. One thing I'd check for sure is the custom HTML writer that you use. |
There is few value-less attributes in HTML which cannot be created with a writer.
e.g. elements as below cannot be created with attributes such as
download
orrequired
.All elements get values:
https://github.com/ckeditor/ckeditor5-engine/blob/da5670ac2a18186111005cb243f46f9fcfb28b2f/src/view/element.js#L772-L788
The text was updated successfully, but these errors were encountered: