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

Html Mode

3 Answers 71 Views
Editor
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Veteran
sitefinitysteve asked on 05 Nov 2015, 08:27 PM

1) Is there no way to globally just have the editor indent the html when it goes to that mode?

2) How do we stop the wrapping of content with spans having inline styling line-height (BLOATED markup)

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 09 Nov 2015, 05:08 PM
Hello Steve,

The Editor's "View HTML" tool allows viewing and editing the widget's raw HTML value. Indeed, formatting that value would be beneficial for the advanced end users that may rely on direct HTML manipulation. I can't seem to find such a feature request on our feedback portal, so please consider submitting one, so that we can evaluate the demand for it and prioritize accordingly.

http://kendoui-feedback.telerik.com/

The Editor is also designed to use inline elements to apply inline formatting, hence the usage of <span> elements in the mentioned case. In theory, it would be possible to look for suitable existing elements to apply the styles to, but that would considerably increase the implementation complexity, so we have opted for a more streamlined and less error-prone approach.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Veteran
answered on 09 Nov 2015, 05:11 PM

@Dimo

Thanks for the reply...regarding #2, I'm not sure what you mean...can the browser just not handle displaying the html?  Why do we need everything wrapped in like <span> with line-height 1.5?  Means I have to override the generated markup.

0
Dimo
Telerik team
answered on 11 Nov 2015, 11:28 AM
Hi Scott,

My assumption is that we are talking about the Editor adding multiple <span> elements to the HTML content when the user applies formatting styles to content, which includes multiple sibling block elements. This is needed, because inline formatting is applied via inline elements. Since inline elements cannot contain block elements, each block element receives an inline child with the specified inline formatting style.

Imagine the following scenario: a bold style or line-height or whatever style needs to be applied to the second half of a list item and the first half of the next list item. There is no other way to achieve this other than using two child elements, one for each list item. A similar logic is followed in other scenarios as well. Even if in certain cases it is possible to assign the style to a single parent element, the Editor is designed to work in the above described way, so that it uses the same algorithm in all cases.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
sitefinitysteve
Top achievements
Rank 2
Veteran
Answers by
Dimo
Telerik team
sitefinitysteve
Top achievements
Rank 2
Veteran
Share this question
or