diff --git a/src/scripts/text.coffee b/src/scripts/text.coffee index dd02c97..69b25a6 100644 --- a/src/scripts/text.coffee +++ b/src/scripts/text.coffee @@ -40,8 +40,10 @@ class ContentEdit.Text extends ContentEdit.Element if @isMounted() @_syncContent() - if @content.isWhitespace() and @can('remove') - # Detatch element from parent if empty + if @content.isWhitespace() and @can('remove') and + Object.keys(@_attributes).length == 0 + # Detatch element from parent if it has neither children nor attributes. + if @parent() @parent().detach(this)