Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add posibility to autoformat HTML source #10

Open
zeleznypa opened this issue Aug 21, 2013 · 0 comments
Open

Add posibility to autoformat HTML source #10

zeleznypa opened this issue Aug 21, 2013 · 0 comments

Comments

@zeleznypa
Copy link

I'm using CKEditor extra few days and manytimes I need to modify HTML source code.
Currently the CKEditor generate strange code format whitch is uncomfortable to edit.

I found great CKEditor plugin HTML Output Writer which provide posibility of setting indentation and break around tags.

Currently I use this settings

        editor.on('instanceReady', function( ev ){
            var index;
            var indentedTags = ["div","header","nav","ol","p","section","ul"];
            for (index = 0; index < indentedTags.length; ++index) {
                ev.editor.dataProcessor.writer.setRules( indentedTags[index] , {
                    indent: true,
                    breakBeforeOpen: true,
                    breakAfterOpen: true,
                    breakBeforeClose: true,
                    breakAfterClose: true
                });
            }
        });

It could be usefull to have indentedTags as system configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant