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

Replacing custom paragraph styles with the default ones does not work

1 Answer 50 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Yuriy
Top achievements
Rank 1
Yuriy asked on 13 May 2014, 04:02 PM
Hi Guys,

I am experiencing the following problem:
I created my custom paragraph style "Small" for the FormatBlock Dropdown. It wraps text in <smal> tag and works as as expected.
However after applying this paragraph style it is not replaced with the <h1> etc. default styles when I choose them in the dropdown.
Steps to reproduce:
1. Put any text to the editor. For example: Test
2. Select it and click on the custom "Small" style in the FormatBlock Dropdown.
     Result in the HTML view: <small>Test</small>.
3. Select the word again and click Heading 1 default style.
    Result in the HTML view: <h1><small>Test</small></h1>.

On the other hand when I choose Heading 1, Heading 2, Menu etc. default styles successively, the current value replaces the old one:
<h1>Test</h1>  =>  <h2>Test</h2>  =>  <menu>Test</menu>  => ...

Is this an expected behavior with the custom  paragraph style or not?
Can you offer how to fix this issue in some simple way?

Best Regards,
Yuriy

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 14 May 2014, 06:33 AM
Hello Yuriy,

The Paragraph Style tool is implemented using native browser commands and its functionality is based on browser logic which is not controlled by the Editor.

The mentioned behavior makes sense. The <small> tag is used as an inline element and as one its natural purpose is to be set as one, so the browser put is as a child and not as a replacement to the parent one. I suggest referring to this help material for more clarification on this matter.

On a side note, if you need somehow a custom functionality, so that you can entirely change the design of the content I can suggest implementing an entirely Customized Dropdown Tool.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Yuriy
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or