This is a migrated thread and some comments may be shown as answers.

Change default html output

2 Answers 72 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 09 Jul 2013, 03:55 PM
When I save off text from the RadEditor, it saves it into html formatting. Is there a way within RadEditor that I can define how to save specific elements? 

I would like to replace the <p>, <br>,<strong>, and <em> tags (possibly others as well) with something else. I realize this is possible through something like a string.replace, but I'm wondering if there is also a way within RadEditor itself.

For instance, this is the output that RadEditor currently provides:
<ol>
    <li>numbered list one</li>
    <li>numbered list two</li>
</ol>
<ul>
    <li>bullet list one</li>
    <li>bullet list two</li>
</ul>
<p><strong>bold word</strong><br />
<br />
<em>italics word</em></p>

and this is what I would like it to be:
<ol>
    <li>numbered list one</li>
    <li>numbered list two</li>
</ol>
<ul>
    <li>bullet list one</li>
    <li>bullet list two</li>
</ul>
& #013;
& #013;
<span style="font-weight:bold">bold word</span>
& #013;
& #013;
<span style="font-style:italic">italics word</span>

2 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 11 Jul 2013, 04:21 PM
Hello Bryan,

Thank you for contacting us.

I am afraid that RadEditor does not support this functionality out-of-the-box. However, you can easily implement it, as you yourself have suggested, by using the get_html() and set_html() methods of the control and a custom regular expression.

Keep in mind that the content might lose its XHTML compliance in case of manual editing of the mark-up.

I hope that you will find the information helpful. Should you have any other questions, do not hesitate to contact us.

Regards,
Ivaylo
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Bryan
Top achievements
Rank 1
answered on 12 Jul 2013, 02:23 PM
Thanks for the response Ivaylo, I'll just work on a custom solution for this. 
Tags
Editor
Asked by
Bryan
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Bryan
Top achievements
Rank 1
Share this question
or