Opened 9 years ago

#1360 new enhancement

Make automatic code indentation in source view mode configurable

Reported by: nicholasbs Owned by: gogo
Priority: normal Milestone: 0.97
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

It's been requested that Xinha's automatic code indentation in source view mode be made optional. I propose that we add a new Xinha configuration variable, indentMarkup (with a default value of true), to make this possible.

Looking at the code, this seems like it should be pretty trivial. One complication I can see is that we'll need to make changes to the getHtml methods in both DOMwalk and TransformInnerHTML.

In TransformInnerHTML, the relevant code is here:

html = Xinha.indent(html);

Commenting out the above should do the trick.

In DOMwalk, changing the following line to not increment indent solves half the problem:

html += Xinha.getHTMLWrapper(i, true, editor, indent + '  ');

...but DOMwalk will still insert newline characters all over the place, so a solution here will require a bit more thought.

Thoughts?

Change History (0)

Note: See TracTickets for help on using tickets.