Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.5.3
[ckeditor.git]
/
_source
/
plugins
/
htmlwriter
/
plugin.js
diff --git
a/_source/plugins/htmlwriter/plugin.js
b/_source/plugins/htmlwriter/plugin.js
index
46fadde
..
d06a125
100644
(file)
--- a/
_source/plugins/htmlwriter/plugin.js
+++ b/
_source/plugins/htmlwriter/plugin.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-57,12
+57,14
@@
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
*/
\r
this.lineBreakChars = '\n';
\r
\r
*/
\r
this.lineBreakChars = '\n';
\r
\r
- this.forceSimpleAmpersand = false;
\r
+ this.forceSimpleAmpersand = 0;
\r
\r
\r
- this.sortAttributes = true;
\r
+ this.sortAttributes = 1;
\r
\r
\r
- this._.indent = false;
\r
+ this._.indent = 0;
\r
this._.indentation = '';
\r
this._.indentation = '';
\r
+ // Indicate preformatted block context status. (#5789)
\r
+ this._.inPre = 0;
\r
this._.rules = {};
\r
\r
var dtd = CKEDITOR.dtd;
\r
this._.rules = {};
\r
\r
var dtd = CKEDITOR.dtd;
\r
@@
-71,35
+73,35
@@
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
{
\r
this.setRules( e,
\r
{
\r
{
\r
this.setRules( e,
\r
{
\r
- indent : true,
\r
- breakBeforeOpen : true,
\r
- breakAfterOpen : true,
\r
+ indent : 1,
\r
+ breakBeforeOpen : 1,
\r
+ breakAfterOpen : 1,
\r
breakBeforeClose : !dtd[ e ][ '#' ],
\r
breakBeforeClose : !dtd[ e ][ '#' ],
\r
- breakAfterClose : true
\r
+ breakAfterClose : 1
\r
});
\r
}
\r
\r
this.setRules( 'br',
\r
{
\r
});
\r
}
\r
\r
this.setRules( 'br',
\r
{
\r
- breakAfterOpen : true
\r
+ breakAfterOpen : 1
\r
});
\r
\r
this.setRules( 'title',
\r
{
\r
});
\r
\r
this.setRules( 'title',
\r
{
\r
- indent : false,
\r
- breakAfterOpen : false
\r
+ indent : 0,
\r
+ breakAfterOpen : 0
\r
});
\r
\r
this.setRules( 'style',
\r
{
\r
});
\r
\r
this.setRules( 'style',
\r
{
\r
- indent : false,
\r
- breakBeforeClose : true
\r
+ indent : 0,
\r
+ breakBeforeClose : 1
\r
});
\r
\r
// Disable indentation on <pre>.
\r
this.setRules( 'pre',
\r
{
\r
});
\r
\r
// Disable indentation on <pre>.
\r
this.setRules( 'pre',
\r
{
\r
- indent: false
\r
+ indent : 0
\r
});
\r
},
\r
\r
});
\r
},
\r
\r
@@
-158,6
+160,7
@@
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
\r
if ( rules && rules.breakAfterOpen )
\r
this.lineBreak();
\r
\r
if ( rules && rules.breakAfterOpen )
\r
this.lineBreak();
\r
+ tagName == 'pre' && ( this._.inPre = 1 );
\r
},
\r
\r
/**
\r
},
\r
\r
/**
\r
@@
-206,6
+209,7
@@
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
}
\r
\r
this._.output.push( '</', tagName, '>' );
\r
}
\r
\r
this._.output.push( '</', tagName, '>' );
\r
+ tagName == 'pre' && ( this._.inPre = 0 );
\r
\r
if ( rules && rules.breakAfterClose )
\r
this.lineBreak();
\r
\r
if ( rules && rules.breakAfterClose )
\r
this.lineBreak();
\r
@@
-223,7
+227,7
@@
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
if ( this._.indent )
\r
{
\r
this.indentation();
\r
if ( this._.indent )
\r
{
\r
this.indentation();
\r
- text = CKEDITOR.tools.ltrim( text );
\r
+ !this._.inPre && ( text = CKEDITOR.tools.ltrim( text ) );
\r
}
\r
\r
this._.output.push( text );
\r
}
\r
\r
this._.output.push( text );
\r
@@
-252,9
+256,9
@@
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
*/
\r
lineBreak : function()
\r
{
\r
*/
\r
lineBreak : function()
\r
{
\r
- if ( this._.output.length > 0 )
\r
+ if ( !this._.inPre && this._.output.length > 0 )
\r
this._.output.push( this.lineBreakChars );
\r
this._.output.push( this.lineBreakChars );
\r
- this._.indent = true;
\r
+ this._.indent = 1;
\r
},
\r
\r
/**
\r
},
\r
\r
/**
\r
@@
-267,8
+271,9
@@
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
*/
\r
indentation : function()
\r
{
\r
*/
\r
indentation : function()
\r
{
\r
- this._.output.push( this._.indentation );
\r
- this._.indent = false;
\r
+ if( !this._.inPre )
\r
+ this._.output.push( this._.indentation );
\r
+ this._.indent = 0;
\r
},
\r
\r
/**
\r
},
\r
\r
/**
\r