core/modules/ckeditor/js/plugins/drupalimagecaption/theme.js | 2 +-
core/modules/filter/css/filter.caption.css | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/core/modules/ckeditor/js/plugins/drupalimagecaption/theme.js b/core/modules/ckeditor/js/plugins/drupalimagecaption/theme.js
index 0663671..f6a9664 100644
--- a/core/modules/ckeditor/js/plugins/drupalimagecaption/theme.js
+++ b/core/modules/ckeditor/js/plugins/drupalimagecaption/theme.js
@@ -182,7 +182,7 @@ CKEDITOR.on('instanceCreated', function (event) {
html += ' data-cke-saved-data-align="' + returnValues.attributes.data_align + '"';
}
html += '/>';
- html += '';
+ html += '';
html += '';
var el = new CKEDITOR.dom.element.createFromHtml(html, editor.document);
editor.insertElement(editor.widgets.wrapElement(el, 'drupalimagecaption'));
diff --git a/core/modules/filter/css/filter.caption.css b/core/modules/filter/css/filter.caption.css
index be9fe20..6358800 100644
--- a/core/modules/filter/css/filter.caption.css
+++ b/core/modules/filter/css/filter.caption.css
@@ -21,6 +21,15 @@
}
/**
+ * While editing and whenever the caption is empty, show a placeholder.
+ *
+ * Based on http://codepen.io/flesler/pen/AEIFc.
+ */
+.caption > figcaption[contenteditable=true]:empty:before {
+ content: attr(data-placeholder);
+}
+
+/**
* Caption alignment.
*/
.caption-left {