Unplanned
Last Updated: 29 Oct 2020 16:05 by Rob
Rob
Created on: 29 Oct 2020 16:05
Category: Editor
Type: Bug Report
0
The content of script tags is modified by the Editor's viewHtml tool

Bug report

Reproduction of the problem

Dojo example.

  1. Open the dev tools console.
  2. Click on the button above the Editor.
  3. The Editor value is logged in the console.
    Note this part in the content:
if (value == 1) { text += "<h2>Apple</h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>>> APPLE Deutschland</a>";
  1. Click on the "viewHtml" tool. In the popup do not make any changes to the content, just click on "Update".
  2. Click on the button above the Editor.
    The mentioned part of the script tag now looks like this:
if (value == 1) { text += "<h2>Apple</h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>>> APPLE Deutschland</a>";

A js exception is thrown after this content is loaded in the div below the Editor, because of the line break after:

if (value == 1) { text += "<h2>Apple</h2>

Current behavior

The viewHtml modifies the content of script tags, which causes js logic to become invalid.

Expected/desired behavior

The viewHtml tool should not make changes to the content of script tags.

Environment

  • Kendo UI version: 2020.3.1021
  • jQuery version: x.y
  • Browser: [all]
0 comments