From f538a05044c466a47a63a9d988501739a3ee5e2b Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 17 Oct 2018 14:33:16 +0200 Subject: [PATCH] Fix an issue with empty mediatag widgets in pads --- www/pad/inner.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/pad/inner.js b/www/pad/inner.js index a97406d70..8f09b91ab 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -497,6 +497,10 @@ define([ userDocStateDom.normalize(); inner.normalize(); + $(userDocStateDom).find('span[data-cke-display-name="media-tag"]:empty').each(function (i, el) { + $(el).remove(); + }); + var patch = (DD).diff(inner, userDocStateDom); (DD).apply(inner, patch); @@ -530,6 +534,10 @@ define([ return str; }); framework.setContentGetter(function () { + $(inner).find('span[data-cke-display-name="media-tag"]:empty').each(function (i, el) { + $(el).remove(); + }); + displayMediaTags(framework, inner, mediaTagMap); inner.normalize(); return Hyperjson.fromDOM(inner, shouldSerialize, hjsonFilters);