Why is <meta> tag shown in viewHtml dialog editor?

0 Answers 13 Views
Editor
Michael
Top achievements
Rank 2
Iron
Iron
Iron
Michael asked on 11 Aug 2025, 02:32 PM

It was my understanding that the Kendo editor is only designed to work with the content between the <body></body> tags and strip off <html>, <head>, and the <body> tags themselves but while I do see that those tags are indeed left out in the dialog editor a <meta> tag that I have in my <head></head> section is still being rendered (ref attached screenshot) which is not desired to the extent that I wish to re-apply the standard "format" to the saved body content changes that re-applies the standard prefix/suffix tags we use to define HTML formatted email templates (Ref below) where the {0} placeholder would represent the true editor content changes for the email template being posted back from client to be saved. However while this works I'm getting the original <meta> tag as part of the "content" when my expectation is, that because it is embedded in the <head> tag that it would get stripped out when the <body></body> internal content is rendered on the client.  I am currently using the 2025.1.227 build of Telerik UI for ASP.NET Core.


private const string EmailTemplateFormat = "<html><head><meta content=\"text/html; charset=windows-1252\" /></head><body style=\"padding: 0; margin: 0;\">{0}</body></html>";

Patrick | Technical Support Engineer, Senior
Telerik team
commented on 13 Aug 2025, 06:30 PM

Hi Michael,

Thank you for reaching out regarding the UI for ASP.NET Core Editor.

To help examine this behavior, I have reached out to our development team for further analysis.  In the meantime, one workaround you could utilize is to remove the meta tag element from the Iframe's content using jQuery:

    $(document).ready(function () {
        var iframe = $('.k-iframe') // Identify the iframe by its class
        var iframeContent = iframe.contents() // Access the content of the iframe
        var metaElement = iframeContent.find('meta') // Traverse down the DOM tree to reach the <meta> element

        metaElement.remove()// Remove all the <meta> elements
    });

Please feel free to take a look at the following Progress Telerik REPL for ASP.NET Core which demonstrates the above.  

Patrick | Technical Support Engineer, Senior
Telerik team
commented on 14 Aug 2025, 02:08 PM

The behavior is considered a bug, and it has now been reported in the following locations:

Please feel free to follow each item for all status updates, and provide comments within the threads for the developer community.

Michael
Top achievements
Rank 2
Iron
Iron
Iron
commented on 14 Aug 2025, 03:23 PM

This is good to hear. I can wait on a bug fix as the feature is not a critical item on our side at the moment.

No answers yet. Maybe you can help?

Tags
Editor
Asked by
Michael
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or