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

HTML-view beautify/formater

2 Answers 174 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alien Interactive AB
Top achievements
Rank 1
Alien Interactive AB asked on 22 Mar 2021, 02:52 PM

Some of our users asked me if it is possible to format the html-code for better readability, some of the content was stored without newlines in the database and results in a pain to read in the html-mode when they need to make some minor changes. 

I'm not looking for something advanced more or less only some indentation and newlines.
Did not find anything useful when searching for this.. 

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 23 Mar 2021, 12:13 PM

Hi Martin,

Can you please make sure that the default IndentHTMLContent filter is not disabled?

Its purpose is to indent the HTML content so it is more readable when you view the code.

You can test it at https://demos.telerik.com/aspnet-ajax/editor/examples/builtincontentfilters/defaultcs.aspx.

Here is how this content looks like initially:

<div class="row page col-md-12 "><h4 style="margin-left:20px;">     <u> text1 </u></h4><p style="margin:30px;">'+text2+'<p></div>    <div class="row page col-md-12 "><h4 style="margin-left:20px;">     <u> text3</u></h4><p style="margin:30px;">'+text4+'<p></div>  <div class="row page col-md-12 "><h4 style="margin-left:20px;">  <u>text5</u></h4><p style="margin:30px;">'+text6+'<p></div>

and after it was indented by the filter:

 

Regards,
Rumen
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Alien Interactive AB
Top achievements
Rank 1
answered on 24 Mar 2021, 02:08 PM

Hi Rumen,

The IndentHTMLContent-filter was not in use, looks a bit better now even if that didn't add so much indentation as the name indicates. However the newlines makes it a lot better.

Thanks!

Tags
Editor
Asked by
Alien Interactive AB
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Alien Interactive AB
Top achievements
Rank 1
Share this question
or