开发者

HTML source indentation for ckeditor

开发者 https://www.devze.com 2023-04-06 11:26 出处:网络
When you add some code to a ckeditor in HTML view and then change to WYSIWYG view and come back, almost all HTML tags have been modified and have loose the indentation. Is there any way to prevent thi

When you add some code to a ckeditor in HTML view and then change to WYSIWYG view and come back, almost all HTML tags have been modified and have loose the indentation. Is there any way to prevent this behaviour? (parameter, plug开发者_StackOverflow中文版in, hard code...)

For example:

<div class="former input">
    <span class="big horizontal">
        <label for="test">Hi world</label>
        <input class="medium free" id="test" name="test" type="text" />
    </span>
</div>

Becomes:

<div class="former input">
    <span class="big horizontal"><label for="test">Hi world</label><input class="medium free" id="test" name="test" type="text" /></span></div>


Here's a link to a page in the developer's guide:
Output Formatting

It explains how to control the layout of the HTML code that is output by the editor and has an example that sets the formatting for the <p> tag.

Try using the <p> tag example as a template and set the formatting for the <span>, <label> and <input> tags using the same approach.

writer.setRules( 'span',
writer.setRules( 'label',
writer.setRules( 'input',

Be Well,
Joe

0

精彩评论

暂无评论...
验证码 换一张
取 消