Adds a symmetrical removeAttribute method to Editor and PostEditor to match the two implementations of setAttribute.
The motivation for this change is to support removing an attribute if a user sets it back to the default value. For example, currently a new section does not have a text-align attribute when created and defaults to being left aligned. However, if the user changes the section to be right aligned, setting the text-align attribute to right, there is currently no way to later change that section back to the default "no explicit text-align" state.
Another option would be to treat setting null or undefined attribute values as removal. However, it seemed better to add an explicit removeAttribute method to align with the DOM attribute API, and there may be use cases where null or undefined attribute values are desired.
Adds a symmetrical
removeAttribute
method toEditor
andPostEditor
to match the two implementations ofsetAttribute
.The motivation for this change is to support removing an attribute if a user sets it back to the default value. For example, currently a new section does not have a
text-align
attribute when created and defaults to being left aligned. However, if the user changes the section to be right aligned, setting thetext-align
attribute toright
, there is currently no way to later change that section back to the default "no explicittext-align
" state.Another option would be to treat setting
null
orundefined
attribute values as removal. However, it seemed better to add an explicitremoveAttribute
method to align with the DOM attribute API, and there may be use cases wherenull
orundefined
attribute values are desired.