There is a bug in the Angular Kendo Editor, whereby it treats any semicolon in the style attribute as a CSS property delimiter. However, not all semicolons are CSS property delimiters, as I will show in an example below.
Version: "@progress/kendo-angular-editor": "16.8.0".
Set the value property of <kendo-editor> to the below value:
<p style="background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo)"> </p>
Note the semicolon in the URL parameter between svg+xml and base64.
When you load the editor, you will get the following error:
TypeError: Cannot read properties of undefined (reading 'trim')
at http://localhost:9090/dev-build/vendor.js:81983:45
at Array.forEach (<anonymous>)
at applyStyle (http://localhost:9090/dev-build/vendor.js:81981:98)
at http://localhost:9090/dev-build/vendor.js:81989:5
at Array.forEach (<anonymous>)
at restoreStyleAttr (http://localhost:9090/dev-build/vendor.js:81986:65)
at htmlToFragment (http://localhost:9090/dev-build/vendor.js:82001:3)
at parseContent (http://localhost:9090/dev-build/vendor.js:82041:15)
at EditorComponent.initialize (http://localhost:9090/dev-build/vendor.js:324747:100)
at Object.next (http://localhost:9090/dev-build/vendor.js:324378:155)
The error seems to be occurring in the file
./node_modules/@progress/kendo-drawing/dist/es2015/svg/utils/render-svg.js
Below is the problematic code. It assumes that any semicolon is a CSS property delimiter, but this is not true, as in the example above,
where the semicolon is part of the CSS value.
const applyStyle = (styleString, element) => styleString.split(';').filter(s => s !== '').forEach(s => { const parts = s.split(':'); element.style[parts[0].trim()] = parts[1].trim(); });