diff --git a/README.md b/README.md
index 56d1a71..3744ed2 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Entity Embed can be installed via the [standard Drupal installation process](htt
 * Go to the 'Text formats and editors' configuration page: `/admin/config/content/formats`, and for each text format/editor combo where you want to embed entities, do the following:
   * Enable the 'Display embedded entities' filter.
   * Drag and drop the 'E' button into the Active toolbar.
-  * If the text format uses the 'Limit allowed HTML tags and correct faulty HTML' filter, ensure the necessary tags and attributes are whitelisted: add ```<drupal-entity data-entity-type data-entity-uuid data-entity-id data-view-mode data-entity-embed-display data-entity-embed-settings>``` to the 'Allowed HTML tags' setting. (Will happen automatically after https://www.drupal.org/node/2554687.)
+  * If the text format uses the 'Limit allowed HTML tags and correct faulty HTML' filter, ensure the necessary tags and attributes are whitelisted: add ```<drupal-entity data-entity-type data-entity-uuid data-entity-id data-view-mode data-entity-embed-display data-entity-embed-settings data-align>``` to the 'Allowed HTML tags' setting. (Will happen automatically after https://www.drupal.org/node/2554687.)
 
 ## Usage
 
diff --git a/js/plugins/drupalentity/plugin.js b/js/plugins/drupalentity/plugin.js
index 389b131..6753689 100644
--- a/js/plugins/drupalentity/plugin.js
+++ b/js/plugins/drupalentity/plugin.js
@@ -27,8 +27,8 @@
 
       // Generic command for adding/editing entities of all types.
       editor.addCommand('editdrupalentity', {
-        allowedContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings]',
-        requiredContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings]',
+        allowedContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings,data-align]',
+        requiredContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings,data-align]',
         modes: { wysiwyg : 1 },
         canUndo: true,
         exec: function (editor, data) {
@@ -66,6 +66,20 @@
             for (var key in attributes) {
               entityElement.setAttribute(key, attributes[key]);
             }
+            
+            if (attributes['data-align']) {
+              var classes = entityElement.getAttribute('class');
+              if (classes != 'undefined'  && classes != null) {
+                  classes += ' align-' + attributes['data-align'];
+              }
+              else {
+                  classes = 'align-' + attributes['data-align'];
+              }
+              
+              entityElement.setAttribute('class', classes);
+              
+            }
+            
             editor.insertHtml(entityElement.getOuterHtml());
             if (existingElement) {
               // Detach the behaviors that were attached when the entity content
@@ -83,8 +97,8 @@
       // Register the entity embed widget.
       editor.widgets.add('drupalentity', {
         // Minimum HTML which is required by this widget to work.
-        allowedContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings]',
-        requiredContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings]',
+        allowedContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings,data-align]',
+        requiredContent: 'drupal-entity[data-entity-type,data-entity-id,data-entity-uuid,data-entity-embed-display,data-entity-embed-settings,data-align]',
 
         // Simply recognize the element as our own. The inner markup if fetched
         // and inserted the init() callback, since it requires the actual DOM
diff --git a/src/EntityHelperTrait.php b/src/EntityHelperTrait.php
index 3f667ac..270b55d 100644
--- a/src/EntityHelperTrait.php
+++ b/src/EntityHelperTrait.php
@@ -193,6 +193,15 @@ trait EntityHelperTrait {
       $context['data-entity-embed-settings'],
       $context
     );
+
+    // Maintain data-align if it is there
+    if ($context['data-align']) {
+      $build['#attributes']['data-align'] = $context['data-align'];
+    }
+    else if ($context['class'] && empty($build['#attributes']['class'])) {
+      $build['#attributes']['class'][] = $context['class'];
+    }
+
     // @todo Should this hook get invoked if $build is an empty array?
     $this->moduleHandler()->alter(array("{$context['data-entity-type']}_embed", 'entity_embed'), $build, $entity, $context);
     $entity_output = $this->renderer()->render($build);
