alloy-editor icon indicating copy to clipboard operation
alloy-editor copied to clipboard

Can't embed youtube video because of wrong attribute data-styles="{"width":"100%"}"

Open georgel-pop-lr opened this issue 4 years ago • 1 comments

Do you want to request a feature or report a bug? Report a bug.

What is the current behaviour? When you try to embed a youtube video using the following code: "<div class="embed-responsive embed-responsive-16by9" data-embed-id="Qv1nRlct5a4" data-styles="{"width":"100%"}" style="width:100%">" In the console an exception is being thrown"VM5500:1 Uncaught SyntaxError: Unexpected token w in JSON at position 1 at JSON.parse () at h.data (embedurl.js:413) at h.g (ckeditor.js?browserId=other&languageId=en_US&b=7201&t=1588939054524:10) at h.fire (ckeditor.js?browserId=other&languageId=en_US&b=7201&t=1588939054524:11) at new h (plugin.js?t=K3FH:7) at q.initOn (plugin.js?t=K3FH:55) at q.initOnAll (plugin.js?t=K3FH:55) at a. (plugin.js?t=K3FH:28) at a.g (ckeditor.js?browserId=other&languageId=en_US&b=7201&t=1588939054524:10) at a. (ckeditor.js?browserId=other&languageId=en_US&b=7201&t=1588939054524:11)" This makes possible to save a wrong HTML code without any possibility of edit or remove it after it.

If the current behaviour is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Try to embed the following code: "<div class="embed-responsive embed-responsive-16by9" data-embed-id="Qv1nRlct5a4" data-styles="{"width":"100%"}" style="width:100%">"
  2. An exception is thrown at "embedurl.js:413"
  3. You can save wrong styles text and without any possible way of editing or removing after it.

What is the expected behaviour? You can save correct style text and with the possibility of editing or removing after it.

Which versions of alloy-editor, and which browser / OS are affected by this issue? Did this work in previous versions? Affects version 2.11.6, affects all browsers. The bug begins when embedurl.js was created and added.

georgel-pop-lr avatar May 18 '20 11:05 georgel-pop-lr

Closed by: https://github.com/liferay/alloy-editor/pull/1394

Released in: https://github.com/liferay/alloy-editor/releases/tag/v2.11.7

liferay-portal PR currently running against CI here: https://github.com/wincent/liferay-portal/pull/277

wincent avatar May 19 '20 13:05 wincent