We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

RichTextEditor - body style

Thread ID:

Created:

Updated:

Platform:

Replies:

123268 Mar 2,2016 05:34 AM Mar 3,2016 06:27 AM ASP.NET MVC 1
loading
Tags: RichTextEditor
Jan Branný
Asked On March 2, 2016 05:34 AM

Hi, 

I would like to remove default formating for RTE. If i create blank document everything is alright. But when I want to edit it RTE insert before my code this html and broke all my formating. 

<html><head> <meta charset="utf-8"> <style>html,body{height:100%;width:100%;} body{font-family:Times New Roman,Times,serif;display:inline-block;}.e-rte-table caption{border: 1px solid;border-bottom:none}body{color:#5C5C5C;margin: 0px;text-indent: 8px;}</style></head><body autocorrect="off" contenteditable="true">

Is it possible to disable this? Or just disable <style>...</style> section?

Thanks for your reply.

Arun Palaniyandi [Syncfusion]
Replied On March 3, 2016 06:27 AM

Hi Jan,

Thanks for contacting Syncfusion support.

Query :  “I would like to remove default formating for RTE. Is it possible to disable this? Or just disable <style>...</style> section?”
          
You can achieve this by triggerring RTE create function and insert a required HTML into the document element.


Please find to the below code snippet:

<code>

#view

@{   

Html.EJ().RTE("rteSample").Width("100%").Height("380px").ClientSideEvents(e => e.Create("RTEcreate")).Render();

}

<script type="text/javascript">

    function RTEcreate(args)

    {

        var rteInstance = $("#rteSample").data("ejRTE");

        // Insert HTML tag

        rteInstance.getDocument().documentElement.innerHTML = "<head></head><body>RTE sample</body>";

    }

</script>

</code>

We have prepared a sample to meet your requirement. Please find the sample from the link: :  http://www.syncfusion.com/downloads/support/forum/123268/ze/MVCsample527264439


Note: If you remove default styles in RTE document, you will see the below cases :
            1).In dark theme, RTE contents will not be shown because of removed body color  (
body{color:#5C5C5C;margin: 0px;text-indent: 8px;}).
            2). Border will not be applied when using table caption because of removed caption border (
.e-rte-table caption{border: 1px solid;border-bottom:none}) .
            3). Body height is considered and calculated based on inner content because of removed body height (
html,body{height:100%;width:100%;})
            4).Font family dropdown will not be selected initially because of removed default font family (
body{font-family:Times New Roman,Times,serif;display:inline-block;}) .


Please let us know the complete issue details, so that we can analyze more and provide an efficient solution.

Regards,
Arun P


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;