Index: /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/opera/textarea.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/opera/textarea.html	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/opera/textarea.html	(revision 225)
@@ -0,0 +1,229 @@
+﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+	We must be in quirks mode.
+-->
+<html>
+<head>
+	<title>Opera Bug</title>
+	<meta content="noindex, nofollow" name="robots" />
+	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+	<!--
+		Remove the following <link> and it will magically work with Opera.
+		It doesn't need to point to a valid css.
+	-->
+	<link href="xxx.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+	<table cellspacing="0" cellpadding="0" style="height: 100%; width: 100%">
+		<tbody>
+			<tr>
+				<td>
+					<textarea style="height: 100%; width: 100%;">This textarea must fill the page, having its own scrollbar.
+It works well with IE and Firefox.
+Line 0
+Line 1
+Line 2
+Line 3
+Line 4
+Line 5
+Line 6
+Line 7
+Line 8
+Line 9
+Line 10
+Line 11
+Line 12
+Line 13
+Line 14
+Line 15
+Line 16
+Line 17
+Line 18
+Line 19
+Line 20
+Line 21
+Line 22
+Line 23
+Line 24
+Line 25
+Line 26
+Line 27
+Line 28
+Line 29
+Line 30
+Line 31
+Line 32
+Line 33
+Line 34
+Line 35
+Line 36
+Line 37
+Line 38
+Line 39
+Line 40
+Line 41
+Line 42
+Line 43
+Line 44
+Line 45
+Line 46
+Line 47
+Line 48
+Line 49
+Line 50
+Line 51
+Line 52
+Line 53
+Line 54
+Line 55
+Line 56
+Line 57
+Line 58
+Line 59
+Line 60
+Line 61
+Line 62
+Line 63
+Line 64
+Line 65
+Line 66
+Line 67
+Line 68
+Line 69
+Line 70
+Line 71
+Line 72
+Line 73
+Line 74
+Line 75
+Line 76
+Line 77
+Line 78
+Line 79
+Line 80
+Line 81
+Line 82
+Line 83
+Line 84
+Line 85
+Line 86
+Line 87
+Line 88
+Line 89
+Line 90
+Line 91
+Line 92
+Line 93
+Line 94
+Line 95
+Line 96
+Line 97
+Line 98
+Line 99
+Line 100
+Line 101
+Line 102
+Line 103
+Line 104
+Line 105
+Line 106
+Line 107
+Line 108
+Line 109
+Line 110
+Line 111
+Line 112
+Line 113
+Line 114
+Line 115
+Line 116
+Line 117
+Line 118
+Line 119
+Line 120
+Line 121
+Line 122
+Line 123
+Line 124
+Line 125
+Line 126
+Line 127
+Line 128
+Line 129
+Line 130
+Line 131
+Line 132
+Line 133
+Line 134
+Line 135
+Line 136
+Line 137
+Line 138
+Line 139
+Line 140
+Line 141
+Line 142
+Line 143
+Line 144
+Line 145
+Line 146
+Line 147
+Line 148
+Line 149
+Line 150
+Line 151
+Line 152
+Line 153
+Line 154
+Line 155
+Line 156
+Line 157
+Line 158
+Line 159
+Line 160
+Line 161
+Line 162
+Line 163
+Line 164
+Line 165
+Line 166
+Line 167
+Line 168
+Line 169
+Line 170
+Line 171
+Line 172
+Line 173
+Line 174
+Line 175
+Line 176
+Line 177
+Line 178
+Line 179
+Line 180
+Line 181
+Line 182
+Line 183
+Line 184
+Line 185
+Line 186
+Line 187
+Line 188
+Line 189
+Line 190
+Line 191
+Line 192
+Line 193
+Line 194
+Line 195
+Line 196
+Line 197
+Line 198
+Line 199
+</textarea>
+				</td>
+			</tr>
+		</tbody>
+	</table>
+</body>
+</html>
Index: /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/createContextualFragment.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/createContextualFragment.html	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/createContextualFragment.html	(revision 225)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Untitled Page</title>
+	<script type="text/javascript">
+
+function InsertHtml()
+{
+	// Get the current selection.
+	var oSel = window.getSelection() ;
+
+	// Get the first available range.
+	var oRange = oSel.getRangeAt(0) ;
+
+	// Create a fragment with the input HTML.
+	var oFragment = oRange.createContextualFragment( '- This is a <b>test</b> -' ) ;
+
+	oRange.insertNode(oFragment) ;
+}
+	</script>
+</head>
+<body>
+	<p>
+		This is some text. Select some text and click the following button to insert HTML on it.
+	</p>
+	<p>
+		<input type="button" value="Insert HTML" onclick="InsertHtml();" />
+	</p>
+</body>
+</html>
Index: /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/hr_undefined.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/hr_undefined.html	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/hr_undefined.html	(revision 225)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Safari Bugs - HR with id=false</title>
+	<script type="text/javascript">
+
+window.onload = function()
+{
+	document.designMode = 'on' ;
+	
+	// This alert is here just to place the focus in the editable document.
+	alert( 'Click OK to insert the <hr>' ) ;	
+
+	document.execCommand( 'InsertHorizontalRule' ) ;
+	
+	alert( 'The resulting HTML is: \n' + document.body.innerHTML + '\nThe desired HTML is:\n<hr />'  ) ;
+}
+
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/input_hidden.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/input_hidden.html	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/_dev/browserbugs/safari/input_hidden.html	(revision 225)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Safari Bugs - Input type hidden</title>
+	<style type="text/css">
+
+input[type="hidden"], span[title="Test"]
+{
+	display: inline;
+	width:20px;
+	height:20px;
+	border:1px dotted #FF0000 ;
+	background-image: url(http://www.fckeditor.net/fckeditor/editor/css/behaviors/hiddenfield.gif);
+	background-repeat: no-repeat;
+}
+
+input[type="hidden"]:after, span[title="Test"]:after
+{
+	padding-left: 20px;
+	content: "" ;
+}
+
+	</style>
+</head>
+<body>
+	<input type="hidden" />
+	<hr />
+	<span title="Test">&nbsp;</span>
+</body>
+</html>
Index: /FCKeditor/branches/features/dataprocessor/_test/automated/tests/fckdataprocessor.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/_test/automated/tests/fckdataprocessor.html	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/_test/automated/tests/fckdataprocessor.html	(revision 225)
@@ -0,0 +1,173 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>FCKDataProcessor - Tests for JsUnit</title>
+	<script src="../../../editor/_source/fckscriptloader.js" type="text/javascript"></script>
+	<script type="text/javascript" src="tests.js"></script>
+	<script type="text/javascript" src="../_jsunit/app/jsUnitCore.js"></script>
+	<script type="text/javascript">
+
+var FCK = 
+{
+	IsDirty : function() { return true ; }
+}
+
+FCKScriptLoader.Load( 'FCKDataProcessor' ) ;
+
+	</script>
+	<script src="../../../fckconfig.js" type="text/javascript"></script>
+	<script type="text/javascript">
+
+function test_ConvertToHtml()
+{
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<html dir="ltr"><head><title></title></head><body>This is some <strong>sample text</strong>.</body></html>',
+		dataProcessor.ConvertToHtml( 'This is some <strong>sample text</strong>.' ) ) ;
+}
+
+function test_ConvertToHtml_Empty()
+{
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<html dir="ltr"><head><title></title></head><body></body></html>',
+		dataProcessor.ConvertToHtml( '' ) ) ;
+}
+
+function test_ConvertToHtml_Full()
+{
+	FCKConfig.FullPage = true ;
+
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<html dir="rtl"><head><title>My Test</title><style></style></head><body class="Test">This is some <strong>sample text</strong>.</body></html>',
+		dataProcessor.ConvertToHtml( '<html dir="rtl"><head><title>My Test</title><style></style></head><body class="Test">This is some <strong>sample text</strong>.</body></html>' ) ) ;
+
+	// Reset the config for other tests.
+	FCKConfig.FullPage = false ;
+}
+
+function test_ConvertToHtml_Full_Incomplete()
+{
+	FCKConfig.FullPage = true ;
+
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<html dir="ltr"><head><title></title></head><body>This is some <strong>sample text</strong>.</body></html>',
+		dataProcessor.ConvertToHtml( 'This is some <strong>sample text</strong>.' ) ) ;
+
+	// Reset the config for other tests.
+	FCKConfig.FullPage = false ;
+}
+
+function test_ConvertToHtml_Full_Empty()
+{
+	FCKConfig.FullPage = true ;
+
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<html dir="ltr"><head><title></title></head><body></body></html>',
+		dataProcessor.ConvertToHtml( '' ) ) ;
+
+	// Reset the config for other tests.
+	FCKConfig.FullPage = false ;
+}
+
+function test_ConvertToHtml_Settings()
+{
+	FCKConfig.ContentLangDirection = 'rtl' ;
+	FCKConfig.DocType = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' ;
+	FCKConfig.BodyId = 'TestId' ;
+	FCKConfig.BodyClass = 'TestClass'
+
+	var dataProcessor = new FCKDataProcessor() ;
+
+	if ( navigator.userAgent.indexOf( 'MSIE' ) > -1 )	// IE
+	{
+		assertEquals(
+			'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' +
+			'<html dir="rtl" style="overflow-y: scroll"><head><title></title></head><body id="TestId" class="TestClass">This is some <strong>sample text</strong>.</body></html>',
+			dataProcessor.ConvertToHtml( 'This is some <strong>sample text</strong>.' ) ) ;
+	}
+	else
+	{
+		assertEquals(
+			'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' +
+			'<html dir="rtl"><head><title></title></head><body id="TestId" class="TestClass">This is some <strong>sample text</strong>.</body></html>',
+			dataProcessor.ConvertToHtml( 'This is some <strong>sample text</strong>.' ) ) ;
+	}
+	// Reset the config for other tests.
+	FCKConfig.ContentLangDirection = 'ltr' ;
+	FCKConfig.DocType = '' ;
+	FCKConfig.BodyId = '' ;
+	FCKConfig.BodyClass = ''
+}
+
+function test_ConvertToDataFormat_Exclude_NoFormat()
+{
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<p>This is a <strong>test</strong>.</p><p>Another paragraph.</p>',
+		dataProcessor.ConvertToDataFormat( document.getElementById('xDiv1'), true ) ) ;
+}
+
+function test_ConvertToDataFormat_NoExclude_NoFormat()
+{
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<div id="xDiv1"><p>This is a <strong>test</strong>.</p><p>Another paragraph.</p></div>',
+		dataProcessor.ConvertToDataFormat( document.getElementById('xDiv1'), false ) ) ;
+}
+
+function test_ConvertToDataFormat_NoExclude_Format()
+{
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'<div id="xDiv1">\n<p>This is a <strong>test</strong>.</p>\n<p>Another paragraph.</p>\n</div>',
+		dataProcessor.ConvertToDataFormat( document.getElementById('xDiv1'), false, false, true ) ) ;
+}
+
+function test_ConvertToDataFormat_IgnoreEmpty()
+{
+	var dataProcessor = new FCKDataProcessor() ;
+
+	assertEquals(
+		'',
+		dataProcessor.ConvertToDataFormat( document.getElementById('xDiv2'), true, true ) ) ;
+}
+
+	</script>
+</head>
+<body>
+	<div id="xDiv1"><p>This is a <strong>test</strong>.</p><p>Another paragraph.</p></div>
+	<div id="xDiv2"><p>&nbsp;</p></div>
+</body>
+</html>
Index: /FCKeditor/branches/features/dataprocessor/_test/manual/fckeditingarea/test1.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/_test/manual/fckeditingarea/test1.html	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/_test/manual/fckeditingarea/test1.html	(revision 225)
@@ -79,6 +79,4 @@
 	var _BehaviorsStyle = '<style type="text/css" _fcktemp="true">' ;
 
-	_BehaviorsStyle += 'INPUT { behavior: url(' + sBasePath + 'editor/css/behaviors/hiddenfield.htc) ; } ' ;
-
 	_BehaviorsStyle += 'TABLE { behavior: url(' + sBasePath + 'editor/css/behaviors/showtableborders.htc) ; }' ;
 
Index: /FCKeditor/branches/features/dataprocessor/_whatsnew.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/_whatsnew.html	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/_whatsnew.html	(revision 225)
@@ -49,5 +49,5 @@
 			file download from one of their mirrors. This disables the ability of "click and
 			go" (which can still be achieved by pointing the download to a file in your server),
-			but removes any troubles with mirros link changes (and they change it frequently).</li>
+			but removes any troubles with mirrors link changes (and they change it frequently).</li>
 		<li>The Word cleanup has been changed to remove "display:none" tags that may come from
 			Word.</li>
@@ -61,5 +61,5 @@
 			generated ASP error 0138.</li>
 		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1288609&group_id=75348">SF
-			BUG-1288609</a>] The content of iframes are preserved.</li>
+			BUG-1288609</a>] The content of iframes is now preserved.</li>
 		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1245504&group_id=75348">SF
 			BUG-1245504</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1652240&group_id=75348">SF
@@ -93,4 +93,32 @@
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/112">#112</a>] The enter
 			key now behaves correctly on lists with Firefox, when the EnterMode is set to 'br'.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/152">#152</a>] Invalid
+			self-closing tags are now being fixed before loading. </li>
+		<li>A few tags were being ignored to the check for required contents (not getting stripped
+			out, as expected). Fixed.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/202">#202</a>] The HR
+			tag will not anymore break the contents loaded in the editor.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/211">#211</a>] Some invalid
+			inputs, like "&lt;p&gt;" where making the caret disappear in Firefox.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/99">#99</a>] The &lt;div&gt;
+			element is now considered a block container if EnterMode=p|br. It acts like a simple
+			block only if EnterMode=div.</li>
+		<li>Hidden fields will now show up as an icon in IE, instead of a normal text field.
+			They are also selectable and draggable, in all browsers.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/213">#213</a>] Styles
+			are now preserved when hitting enter at the end of a paragraph.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/77">#77</a>] If ShiftEnterMode
+			is set to a block tag (p or div), the desired block creation in now enforced, instead
+			of copying the current block (which is still the behavior of the simple enter).</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/209">#209</a>] Links and
+			images URLs will now be correctly preserved with Netscape 7.1.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/165">#165</a>] The enter
+			key now honors the EnterMode settings when outdenting a list item.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/190">#190</a>] Toolbars
+			may be wrongly positioned. Fixed.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/254">#254</a>] The IgnoreEmptyParagraphValue
+			setting is now correctly handled in Firefox.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/254">#248</a>] The behavior
+			of the backspace key has been fixed on some very specific cases.</li>
 	</ul>
 	<h3>
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckdataprocessor.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckdataprocessor.js	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckdataprocessor.js	(revision 225)
@@ -0,0 +1,163 @@
+﻿/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * The Data Processor is responsible for transforming the input and output data
+ * in the editor. For more info:
+ * http://dev.fckeditor.net/wiki/Components/DataProcessor
+ *
+ * The default implementation offers the base XHTML compatibility features of
+ * FCKeditor. Further Data Processors may be implemented for other purposes.
+ *
+ */
+
+var FCKDataProcessor = function()
+{}
+
+FCKDataProcessor.prototype =
+{
+	/*
+	 * Returns a string representing the HTML format of "data". The returned
+	 * value will be loaded in the editor.
+	 * The HTML must be from <html> to </html>, including <head>, <body> and
+	 * eventually the DOCTYPE.
+	 * Note: HTML comments may already be part of the data because of the
+	 * pre-processing made with ProtectedSource.
+	 *     @param {String} data The data to be converted in the
+	 *            DataProcessor specific format.
+	 */
+	ConvertToHtml : function( data )
+	{
+		// Protect event attributes (they could get fired in the editing area).
+		data = this._ProtectEvents( data ) ;
+
+		// The default data processor must handle two different cases depending
+		// on the FullPage setting. Custom Data Processors will not be
+		// compatible with FullPage, much probably.
+		if ( FCKConfig.FullPage )
+		{
+			// Save the DOCTYPE.
+			FCK.DocTypeDeclaration = data.match( FCKRegexLib.DocTypeTag ) ;
+
+			// Check if the <body> tag is available.
+			if ( !FCKRegexLib.HasBodyTag.test( data ) )
+				data = '<body>' + data + '</body>' ;
+
+			// Check if the <html> tag is available.
+			if ( !FCKRegexLib.HtmlOpener.test( data ) )
+				data = '<html dir="' + FCKConfig.ContentLangDirection + '">' + data + '</html>' ;
+
+			// Check if the <head> tag is available.
+			if ( !FCKRegexLib.HeadOpener.test( data ) )
+				data = data.replace( FCKRegexLib.HtmlOpener, '$&<head><title></title></head>' ) ;
+
+			return data ;
+		}
+		else
+		{
+			var html =
+				FCKConfig.DocType +
+				'<html dir="' + FCKConfig.ContentLangDirection + '"' ;
+
+			// On IE, if you are using a DOCTYPE different of HTML 4 (like
+			// XHTML), you must force the vertical scroll to show, otherwise
+			// the horizontal one may appear when the page needs vertical scrolling.
+			// TODO : Check it with IE7 and make it IE6- if it is the case.
+			if ( FCKBrowserInfo.IsIE && FCKConfig.DocType.length > 0 && !FCKRegexLib.Html4DocType.test( FCKConfig.DocType ) )
+				html += ' style="overflow-y: scroll"' ;
+
+			html += '><head><title></title></head><body' ;
+
+			// Add id and class to the body.
+			if ( FCKConfig.BodyId.length > 0 )
+				html += ' id="' + FCKConfig.BodyId + '"' ;
+			if ( FCKConfig.BodyClass.length > 0 )
+				html += ' class="' + FCKConfig.BodyClass + '"' ;
+
+			html +=
+				'>' +
+				data +
+				'</body></html>' ;
+
+			return html ;
+		}
+	},
+
+	/*
+	 * Converts a DOM (sub-)tree to a string in the data format.
+	 *     @param {Object} rootNode The node that contains the DOM tree to be
+	 *            converted to the data format.
+	 *     @param {Boolean} excludeRoot Indicates that the root node must not
+	 *            be included in the conversion, only its children.
+	 *     @param {Boolean} format Indicates that the data must be formatted
+	 *            for human reading. Not all Data Processors may provide it.
+	 */
+	ConvertToDataFormat : function( rootNode, excludeRoot, ignoreIfEmptyParagraph, format )
+	{
+		var data = FCKXHtml.GetXHTML( rootNode, !excludeRoot, format ) ;
+
+		if ( ignoreIfEmptyParagraph && FCKRegexLib.EmptyOutParagraph.test( data ) )
+			return '' ;
+
+		// Restore protected event attributes.
+		data = this._ProtectEventsRestore( data ) ;
+
+		return data ;
+	},
+
+	/*
+	 * Makes any necessary changes to a piece of HTML for insertion in the
+	 * editor selection position.
+	 *     @param {String} html The HTML to be fixed.
+	 */
+	FixHtml : function( html )
+	{},
+
+	// Saves event attributes (like onclick) so they don't get executed while
+	// editing.
+	_ProtectEvents : function( html )
+	{
+		return html.replace( FCKRegexLib.TagsWithEvent, _FCKDataProcessor_ProtectEvents_ReplaceTags ) ;
+	},
+
+	_ProtectEventsRestore : function( html )
+	{
+		return html.replace( FCKRegexLib.ProtectedEvents, _FCKDataProcessor_ProtectEvents_RestoreEvents ) ;
+	}
+} ;
+
+// Replace all events attributes (like onclick).
+function _FCKDataProcessor_ProtectEvents_ReplaceTags( tagMatch )
+{
+	return tagMatch.replace( FCKRegexLib.EventAttributes, _FCKDataProcessor_ProtectEvents_ReplaceEvents ) ;
+}
+
+// Replace an event attribute with its respective __fckprotectedatt attribute.
+// The original event markup will be encoded and saved as the value of the new
+// attribute.
+function _FCKDataProcessor_ProtectEvents_ReplaceEvents( eventMatch, attName )
+{
+	return ' ' + attName + '_fckprotectedatt="' + eventMatch.ReplaceAll( [/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g], ['&apos;','&#39;','&quot;','&#61;','&lt;','&gt;','&#10;','&#13;'] ) + '"' ;
+}
+
+function _FCKDataProcessor_ProtectEvents_RestoreEvents( match, encodedOriginal )
+{
+	return encodedOriginal.ReplaceAll( [/&#39;/g,/&quot;/g,/&#61;/g,/&lt;/g,/&gt;/g,/&#10;/g,/&#13;/g,/&apos;/g], ["'",'"','=','<','>','\r','\n','&'] ) ;
+}
+
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckdomrange.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckdomrange.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckdomrange.js	(revision 225)
@@ -118,4 +118,17 @@
 	},
 
+	// Moves to the first editing point inside a element. For example, in a
+	// element tree like "<p><b><i></i></b> Text</p>", the start editing point
+	// is "<p><b><i>^</i></b> Text</p>" (inside <i>).
+	MoveToElementEditStart : function( targetElement )
+	{
+		var child ;
+
+		while ( ( child = targetElement.firstChild ) && child.nodeType == 1 && FCKListsLib.EmptyElements[ child.nodeName.toLowerCase() ] == null )
+			targetElement = child ;
+
+		this.MoveToElementStart( targetElement ) ;
+	},
+
 	InsertNode : function( node )
 	{
@@ -167,6 +180,31 @@
 		oTestRange.SetEnd( oTestRange.EndBlock || oTestRange.EndBlockLimit, 2 ) ;
 
-		var bIsEndOfBlock = oTestRange.CheckIsEmpty( true ) ;
-
+		var bIsEndOfBlock = oTestRange.CheckIsCollapsed() ;
+		
+		if ( !bIsEndOfBlock )
+		{
+			// Inserts the contents of the range in a div tag.
+			var eToolDiv = this.Window.document.createElement( 'div' ) ;
+			oTestRange._Range.cloneContents().AppendTo( eToolDiv ) ;
+			FCKDomTools.TrimNode( eToolDiv, true ) ;
+			
+			// Find out if we are in an empty tree of inline elements, like <b><i><span></span></i></b>
+			bIsEndOfBlock = true ;
+			var eLastChild = eToolDiv ;
+			while ( ( eLastChild = eLastChild.lastChild ) )
+			{
+				// Check the following:
+				//		1. Is there more than one node in the parents children?
+				//		2. Is the node not an element node?
+				//		3. Is it not a inline element.
+				if ( eLastChild.previousSibling || eLastChild.nodeType != 1 || FCKListsLib.InlineChildReqElements[ eLastChild.nodeName.toLowerCase() ] == null )
+				{
+					// So we are not in the end of the range.
+					bIsEndOfBlock = false ;
+					break ;
+				}
+			}
+		}
+		
 		oTestRange.Release() ;
 
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckeditingarea.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckeditingarea.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckeditingarea.js	(revision 225)
@@ -219,4 +219,6 @@
 		if ( this.Mode == FCK_EDITMODE_WYSIWYG )
 		{
+			// The following check is important to avoid IE entering in a focus loop. Ref:
+			// http://sourceforge.net/tracker/index.php?func=detail&aid=1567060&group_id=75348&atid=543653
 			if ( FCKBrowserInfo.IsIE && this.Document.hasFocus() )
 				return ;
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckelementpath.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckelementpath.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckelementpath.js	(revision 225)
@@ -42,14 +42,16 @@
 			var sElementName = e.nodeName.toLowerCase() ;
 
-			if ( !eBlockLimit && !eBlock && FCKListsLib.PathBlockElements[ sElementName ] != null )
-				eBlock = e ;
+			if ( !eBlockLimit )
+			{
+				if ( !eBlock && FCKListsLib.PathBlockElements[ sElementName ] != null )
+					eBlock = e ;
 
-			// TODO: Review the Regex and move it to the RegexLib.
-			if ( !eBlockLimit && (/^(?:body|td|th|caption|form)$/).test( sElementName ) )
-				eBlockLimit = e ;
+				if ( FCKListsLib.PathBlockLimitElements[ sElementName ] != null )
+					eBlockLimit = e ;
+			}
 
 			aElements.push( e ) ;
 
-			if ( sElementName == 'BODY' )
+			if ( sElementName == 'body' )
 				break ;
 		}
@@ -62,2 +64,3 @@
 }
 
+
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckenterkey.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckenterkey.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckenterkey.js	(revision 225)
@@ -57,6 +57,8 @@
 	var oEnterKey = this._EnterKey ;
 
+	/* @Packager.RemoveLine
 	try
 	{
+	@Packager.RemoveLine */
 		switch ( keystrokeValue )
 		{
@@ -76,4 +78,5 @@
 				return oEnterKey.DoDelete() ;
 		}
+	/* @Packager.RemoveLine
 	}
 	catch (e)
@@ -82,4 +85,5 @@
 		// ahead with the browser default behavior.
 	}
+	@Packager.RemoveLine */
 
 	return false ;
@@ -123,5 +127,4 @@
 		return false ;
 
-
 	var oStartBlock = oRange.StartBlock ;
 	var oEndBlock = oRange.EndBlock ;
@@ -176,6 +179,6 @@
 	if ( !previous && currentBlock.nodeName.IEquals( 'LI' ) && currentBlock.parentNode.parentNode.nodeName.IEquals( 'LI' ) )
 	{
-		previous = currentBlock.parentNode.parentNode ;
-		currentBlock = FCKListHandler.OutdentListItem( currentBlock ) ;
+		this._OutdentWithSelection( currentBlock, range ) ;
+		return true ;
 	}
 
@@ -193,12 +196,16 @@
 	if ( previous && currentBlock )
 	{
-		// If we are in a LI, and the previous block is not an LI, we must
+		// If we are in a LI, and the previous block is not an LI, we must outdent it.
 		if ( currentBlock.nodeName.IEquals( 'LI' ) && !previous.nodeName.IEquals( 'LI' ) )
-			currentBlock = FCKListHandler.OutdentListItem( currentBlock ) ;
+		{
+			this._OutdentWithSelection( currentBlock, range ) ;
+			return true ;
+		}
 
 		// Take a reference to the parent for post processing cleanup.
 		var oCurrentParent = currentBlock.parentNode ;
 
-		if ( previous.nodeName.IEquals( 'TABLE', 'HR' ) )
+		var sPreviousName = previous.nodeName.toLowerCase() ;
+		if ( FCKListsLib.EmptyElements[ sPreviousName ] != null || sPreviousName == 'table' )
 		{
 			FCKDomTools.RemoveNode( previous ) ;
@@ -277,5 +284,5 @@
 	// Get the current selection.
 	var oRange = range || new FCKDomRange( this.Window ) ;
-	
+
 	// If we don't have a range, move it to the selection.
 	if ( !range )
@@ -330,5 +337,5 @@
 
 				// Move the selection to the new block.
-				oRange.MoveToElementStart( eStartBlock ) ;
+				oRange.MoveToElementEditStart( eStartBlock ) ;
 			}
 			else
@@ -342,15 +349,20 @@
 					if ( bIsStartOfBlock && sStartBlockTag == 'LI' )
 					{
-						var eOutdented = FCKListHandler.OutdentListItem( eStartBlock ) ;
-						oRange.MoveToElementStart( eOutdented ) ;
+						this._OutdentWithSelection( eStartBlock, oRange ) ;
+						oRange.Release() ;
+						return true ;
 					}
 					else
 					{
-						// If is a header tag, create a new block element.
-						if ( (/^H[1-6]$/).test( sStartBlockTag ) )
+						// If is a header tag, or we are in a Shift+Enter (#77),
+						// create a new block element.
+						if ( (/^H[1-6]$/).test( sStartBlockTag ) || this._HasShift )
 							eNewBlock = this.Window.document.createElement( blockTag ) ;
 						// Otherwise, duplicate the current block.
 						else
+						{
 							eNewBlock = eStartBlock.cloneNode(false) ;
+							this._RecreateEndingTree( eStartBlock, eNewBlock ) ;
+						}
 
 						if ( FCKBrowserInfo.IsGeckoLike )
@@ -384,8 +396,6 @@
 					{
 						// In Gecko, the last child node must be a bogus <br>.
-						var eLastChild = FCKDomTools.GetLastChild( eNewBlock ) ;
-
-						if ( !eLastChild || eLastChild.nodeName.toLowerCase() != 'br' || eLastChild.getAttribute( 'type', 2 ) != '_moz' )
-							eNewBlock.appendChild( FCKTools.CreateBogusBR( this.Window.document ) ) ;
+						this._AppendBogusBr( eStartBlock ) ;
+						this._AppendBogusBr( eNewBlock ) ;
 					}
 				}
@@ -396,5 +406,5 @@
 
 					// Move the selection to the new block.
-					oRange.MoveToElementStart( eNewBlock ) ;
+					oRange.MoveToElementEditStart( eNewBlock ) ;
 
 					if ( FCKBrowserInfo.IsGecko )
@@ -406,5 +416,5 @@
 		{
 			// Move the selection to the end block.
-			oRange.MoveToElementStart( eEndBlock ) ;
+			oRange.MoveToElementEditStart( eEndBlock ) ;
 		}
 
@@ -471,10 +481,5 @@
 			// If we are at the end of a block, we must be sure the bogus node is available in that block.
 			if ( bIsEndOfBlock && FCKBrowserInfo.IsGecko )
-			{
-				var eLastBr = FCKDomTools.GetLastChild( eBr.parentNode, 'BR' ) ;
-
-				if ( eLastBr && eLastBr.getAttribute( 'type', 2 ) != '_moz' )
-					eBr.parentNode.appendChild( FCKTools.CreateBogusBR( this.Window.document ) ) ;
-			}
+				this._AppendBogusBr( eBr.parentNode ) ;
 
 			if ( FCKBrowserInfo.IsIE )
@@ -522,2 +527,35 @@
 	range.MoveToBookmark( oBookmark ) ;
 }
+
+// Appends a bogus <br> at the end of the element, if not yet available.
+FCKEnterKey.prototype._AppendBogusBr = function( element )
+{
+	var eLastChild = element.getElementsByTagName('br') ;
+
+	if ( eLastChild )
+		eLastChild = eLastChild[ eLastChild.legth - 1 ] ;
+
+	if ( !eLastChild || eLastChild.getAttribute( 'type', 2 ) != '_moz' )
+		element.appendChild( FCKTools.CreateBogusBR( this.Window.document ) ) ;
+}
+
+// Recreate the elements tree at the end of the source block, at the beginning
+// of the target block. Eg.:
+//	If source = <p><u>Some</u> sample <b><i>text</i></b></p> then target = <p><b><i></i></b></p>
+//	If source = <p><u>Some</u> sample text</p> then target = <p></p>
+FCKEnterKey.prototype._RecreateEndingTree = function( source, target )
+{
+	while ( ( source = source.lastChild ) && source.nodeType == 1 && FCKListsLib.InlineChildReqElements[ source.nodeName.toLowerCase() ] != null )
+		target = target.insertBefore( source.cloneNode( false ), target.firstChild ) ;
+}
+
+// Outdents a LI, maintaining the seletion defined on a range.
+FCKEnterKey.prototype._OutdentWithSelection = function( li, range )
+{
+	var oBookmark = range.CreateBookmark() ;
+
+	FCKListHandler.OutdentListItem( li ) ;
+
+	range.MoveToBookmark( oBookmark ) ;
+	range.Select() ;
+}
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck.js	(revision 225)
@@ -91,4 +91,7 @@
 		this.EditingArea.FFSpellChecker = false ;
 
+		// Final setup of the lists lib.
+		FCKListsLib.Setup() ;
+
 		// Set the editor's startup contents
 		this.SetData( this.GetLinkedFieldValue(), true ) ;
@@ -214,9 +217,12 @@
 			data = data.replace( FCKRegexLib.ToReplace, '$1' ) ;
 
-		if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
-			data = FCK.DocTypeDeclaration + '\n' + data ;
-
-		if ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 )
-			data = FCK.XmlDeclaration + '\n' + data ;
+		if ( isFullPage )
+		{
+			if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
+				data = FCK.DocTypeDeclaration + '\n' + data ;
+
+			if ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 )
+				data = FCK.XmlDeclaration + '\n' + data ;
+		}
 
 		return FCKConfig.ProtectedSource.Revert( data ) ;
@@ -258,8 +264,8 @@
 	{
 		// <A> href
-		html = html.replace( FCKRegexLib.ProtectUrlsA	, '$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2' ) ;
+		html = html.replace( FCKRegexLib.ProtectUrlsA	, '$& _fcksavedurl=$1' ) ;
 
 		// <IMG> src
-		html = html.replace( FCKRegexLib.ProtectUrlsImg	, '$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2' ) ;
+		html = html.replace( FCKRegexLib.ProtectUrlsImg	, '$& _fcksavedurl=$1' ) ;
 
 		return html ;
@@ -268,20 +274,33 @@
 	ProtectTags : function( html )
 	{
-		// <meta> tags get executed, so if you have a redirect meta, the content
-		// will move to the target page.
-		var sTags = 'META' ;
-
-		if ( FCKConfig.ProtectedTags.length > 0 )
-			sTags += '|' + FCKConfig.ProtectedTags ;
+		var sTags = FCKConfig.ProtectedTags ;
 
 		// IE doesn't support <abbr> and it breaks it. Let's protect it.
 		if ( FCKBrowserInfo.IsIE )
-			sTags += '|ABBR' ;
-
-		var oRegex = new RegExp( '<(' + sTags + ')([ \>])', 'gi' ) ;
-		html = html.replace( oRegex, '<FCK:$1$2' ) ;
-
-		oRegex = new RegExp( '<\/(' + sTags + ')>', 'gi' ) ;
-		html = html.replace( oRegex, '<\/FCK:$1>' ) ;
+			sTags += sTags.length > 0 ? '|ABBR' : 'ABBR' ;
+		
+		var oRegex ;
+		if ( sTags.length > 0 )
+		{
+			oRegex = new RegExp( '<(' + sTags + ')(?!\w|:)', 'gi' ) ;
+			html = html.replace( oRegex, '<FCK:$1' ) ;
+
+			oRegex = new RegExp( '<\/(' + sTags + ')>', 'gi' ) ;
+			html = html.replace( oRegex, '<\/FCK:$1>' ) ;
+		}
+		
+		// Protect some empty elements. We must do it separately becase the
+		// original tag may not contain the closing slash, like <hr>:
+		//		- <meta> tags get executed, so if you have a redirect meta, the
+		//		  content will move to the target page.
+		//		- <hr> may destroy the document structure if not well
+		//		  positioned. The trick is protect it here and restore them in
+		//		  the FCKDocumentProcessor.
+		sTags = 'META' ;
+		if ( FCKBrowserInfo.IsIE )
+			sTags += '|HR' ;
+
+		oRegex = new RegExp( '<((' + sTags + ')(?=\s|>)[\s\S]*?)/?>', 'gi' ) ;
+		html = html.replace( oRegex, '<FCK:$1 />' ) ;
 
 		return html ;
@@ -304,4 +323,7 @@
 			data = FCK.DataProcessor.ConvertToHtml( data ) ;
 
+			// Fix for invalid self-closing tags (see #152).
+			data = data.replace( FCKRegexLib.InvalidSelfCloseTags, '$1></$2>' ) ;
+			
 			// Protect some things from the browser itself.
 			data = FCK.ProtectUrls( data ) ;
@@ -566,4 +588,10 @@
 		FCK.ResetIsDirty() ;
 
+	// This is a tricky thing for IE. In some cases, even if the cursor is
+	// blinking in the editing, the keystroke handler doesn't catch keyboard
+	// events. We must activate the editing area to make it work. (#142).
+	if ( FCKBrowserInfo.IsIE && FCK.HasFocus )
+		FCK.EditorDocument.body.setActive() ;
+
 	FCK.OnAfterSetHTML() ;
 
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_contextmenu.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_contextmenu.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_contextmenu.js	(revision 225)
@@ -203,5 +203,5 @@
 			AddItems : function( menu, tag, tagName )
 			{
-				if ( tagName == 'INPUT' && tag.type == 'hidden' )
+				if ( tagName == 'IMG' && tag.getAttribute( '_fckinputhidden' ) )
 				{
 					menu.AddSeparator() ;
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_ie.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_ie.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_ie.js	(revision 225)
@@ -36,7 +36,5 @@
 		// The behaviors should be pointed using the FullBasePath to avoid security
 		// errors when using a differente BaseHref.
-		sStyle =
-			'<style type="text/css" _fcktemp="true">' +
-			'INPUT { behavior: url(' + sBasePath + 'css/behaviors/hiddenfield.htc) ; }' ;
+		sStyle = '<style type="text/css" _fcktemp="true">' ;
 
 		if ( FCKConfig.ShowBorders )
@@ -44,5 +42,5 @@
 
 		// Disable resize handlers.
-		sStyle += 'INPUT,TEXTAREA,SELECT,.FCK__Anchor,.FCK__PageBreak' ;
+		sStyle += 'INPUT,TEXTAREA,SELECT,.FCK__Anchor,.FCK__PageBreak,.FCK__InputHidden' ;
 
 		if ( FCKConfig.DisableObjectResizing )
@@ -245,5 +243,5 @@
 		FCK._PasteIsRunning = true ;
 
-		FCK.GetClipboardHTML() ;
+		FCK.ExecuteNamedCommand( 'Paste' ) ;
 
 		// Removes the semaphore.
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckdocumentprocessor.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckdocumentprocessor.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckdocumentprocessor.js	(revision 225)
@@ -197,2 +197,47 @@
 	return e ;
 }
+
+// HR Processor.
+// This is a IE only (tricky) thing. We protect all HR tags before loading them
+// (see FCK.ProtectTags). Here we put the HRs back.
+if ( FCKBrowserInfo.IsIE )
+{
+	FCKDocumentProcessor.AppendNew().ProcessDocument = function( document )
+	{
+		var aHRs = document.getElementsByTagName( 'HR' ) ;
+
+		var eHR ;
+		var i = aHRs.length - 1 ;
+		while ( i >= 0 && ( eHR = aHRs[i--] ) )
+		{
+			// Create the replacement HR.
+			var newHR = document.createElement( 'hr' ) ;
+			newHR.mergeAttributes( eHR, true ) ;
+			
+			// We must insert the new one after it. insertBefore will not work in all cases.
+			FCKDomTools.InsertAfterNode( eHR, newHR ) ;
+
+			eHR.parentNode.removeChild( eHR ) ;
+		}
+	}
+}
+
+// INPUT:hidden Processor.
+FCKDocumentProcessor.AppendNew().ProcessDocument = function( document )
+{
+	var aInputs = document.getElementsByTagName( 'INPUT' ) ;
+
+	var oInput ;
+	var i = aInputs.length - 1 ;
+	while ( i >= 0 && ( oInput = aInputs[i--] ) )
+	{
+		if ( oInput.type == 'hidden' )
+		{
+			var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__InputHidden', oInput.cloneNode(true) ) ;
+			oImg.setAttribute( '_fckinputhidden', 'true', 0 ) ;
+
+			oInput.parentNode.insertBefore( oImg, oInput ) ;
+			oInput.parentNode.removeChild( oInput ) ;
+		}
+	}
+}
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckdomtools.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckdomtools.js	(revision 225)
@@ -159,5 +159,19 @@
 	},
 
-	// Get the previous element in the source order.
+	/*
+	 * Gets the previous element (nodeType=1) in the source order. Returns
+	 * "null" If no element is found.
+	 *		@param {Object} currentNode The node to start searching from.
+	 *		@param {Boolean} ignoreSpaceTextOnly Sets how text nodes will be
+	 *				handled. If set to "true", only white spaces text nodes
+	 *				will be ignored, while non white space text nodes will stop
+	 *				the search, returning null. If "false" or ommitted, all
+	 *				text nodes are ignored.
+	 *		@param {string[]} stopSearchElements An array of element names that
+	 *				will cause the search to stop when found, returning null.
+	 *				May be ommitted (or null).
+	 *		@param {string[]} ignoreElements An array of element names that
+	 *				must be ignored during the search.
+	 */
 	GetPreviousSourceElement : function( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements )
 	{
@@ -195,5 +209,19 @@
 	},
 
-	// Get the previous element in the source order.
+	/*
+	 * Gets the next element (nodeType=1) in the source order. Returns
+	 * "null" If no element is found.
+	 *		@param {Object} currentNode The node to start searching from.
+	 *		@param {Boolean} ignoreSpaceTextOnly Sets how text nodes will be
+	 *				handled. If set to "true", only white spaces text nodes
+	 *				will be ignored, while non white space text nodes will stop
+	 *				the search, returning null. If "false" or ommitted, all
+	 *				text nodes are ignored.
+	 *		@param {string[]} stopSearchElements An array of element names that
+	 *				will cause the search to stop when found, returning null.
+	 *				May be ommitted (or null).
+	 *		@param {string[]} ignoreElements An array of element names that
+	 *				must be ignored during the search.
+	 */
 	GetNextSourceElement : function( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements )
 	{
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fcklisthandler.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fcklisthandler.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fcklisthandler.js	(revision 225)
@@ -99,9 +99,19 @@
 				}
 
-				var eBlock = oDocument.createElement( 'p' ) ;	// TODO: Get from configuration.
+				var eBlock = oDocument.createElement( FCKConfig.EnterMode == 'p' ? 'p' : 'div' ) ;
 				FCKDomTools.MoveChildren( eParent.removeChild( listItem ), eBlock ) ;
 				FCKDomTools.InsertAfterNode( eParent, eBlock ) ;
 
-				listItem = eBlock ;
+				if ( FCKConfig.EnterMode == 'br' )
+				{
+					// We need the bogus to make it work properly. In Gecko, we
+					// need it before the new block, on IE, after it.
+					if ( FCKBrowserInfo.IsGecko )
+						eBlock.parentNode.insertBefore( FCKTools.CreateBogusBR( oDocument ), eBlock ) ;
+					else
+						FCKDomTools.InsertAfterNode( eBlock, FCKTools.CreateBogusBR( oDocument ) ) ;
+
+					FCKDomTools.RemoveNode( eBlock, true ) ;
+				}
 			}
 
@@ -109,6 +119,4 @@
 				FCKDomTools.RemoveNode( eParent, true ) ;
 		}
-
-		return listItem ;
 	},
 
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fcklistslib.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fcklistslib.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fcklistslib.js	(revision 225)
@@ -29,16 +29,32 @@
 {
 	// We are not handling <ins> and <del> as block elements, for now.
-	BlockElements : { address:1,blockquote:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },
+	BlockElements : { address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },
 
 	// Block elements that may be filled with &nbsp; if empty.
 	NonEmptyBlockElements : { p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },
 
-	// Elements that may be considered the "Block boundary" in an element path.
-	PathBlockElements : { address:1,blockquote:1,div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 },
-
 	// Inline elements which MUST have child nodes.
-	InlineChildReqElements : { abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strong:1,sub:1,sup:1,tt:1,'var':1 },
+	InlineChildReqElements : { abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },
 
 	// Elements marked as empty "Empty" in the XHTML DTD.
-	EmptyElements : { base:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 }
+	EmptyElements : { base:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },
+	
+	// Elements that may be considered the "Block boundary" in an element path.
+	PathBlockElements : { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 },
+	
+	// Elements that may be considered the "Block limit" in an element path.
+	PathBlockLimitElements : { body:1,td:1,th:1,caption:1,form:1 },
+
+	// Final setup of FCKListsLib once the editor is loaded (at FCK.StartEditor). 
+	// TODO: For v3, there should be a generic way to register to the editor
+	// startup event, so this function would not be needed to be defined here, not
+	// even be called at FCK.StartEditor.
+	Setup : function()
+	{
+		// <div> is considered a block element only if EnterMode=div, otherwise it is a block limit.
+		if ( FCKConfig.EnterMode == 'div' )
+			this.PathBlockElements.div = 1 ;
+		else
+			this.PathBlockLimitElements.div = 1 ;
+	}
 } ;
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckregexlib.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckregexlib.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckregexlib.js	(revision 225)
@@ -60,5 +60,8 @@
 SpaceNoClose	: /\/>/g ,
 
-EmptyParagraph	: /^<(p|div)>\s*<\/\1>$/i ,
+// Empty elements may be <p></p> or even a simple opening <p> (see #211).
+EmptyParagraph	: /^<([^ >]+)[^>]*>\s*(<\/\1>)?$/ ,
+
+EmptyOutParagraph : /^<([^ >]+)[^>]*>(?:\s*|&nbsp;)(<\/\1>)?$/ ,
 
 TagBody			: /></ ,
@@ -74,6 +77,6 @@
 // them. We have to do all in one, otherwhise we will have problems with URLs
 // like "thumbnail.php?src=someimage.jpg" (SF-BUG 1554141).
-ProtectUrlsImg	: /(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi ,
-ProtectUrlsA	: /(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi ,
+ProtectUrlsImg	: /<img(?=\s).*?\ssrc=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi ,
+ProtectUrlsA	: /<a(?=\s).*?\shref=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi ,
 
 Html4DocType	: /HTML 4\.0 Transitional/i ,
@@ -85,4 +88,7 @@
 ProtectedEvents : /\s\w+_fckprotectedatt="([^"]+)"/g,
 
-StyleProperties : /\S+\s*:/g
+StyleProperties : /\S+\s*:/g,
+
+// [a-zA-Z0-9:]+ seams to be more efficient than [\w:]+
+InvalidSelfCloseTags : /(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi
 } ;
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckxhtml.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckxhtml.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckxhtml.js	(revision 225)
@@ -364,5 +364,5 @@
 		}
 
-		FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
+		node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
 
 		return node ;
@@ -406,5 +406,5 @@
 			FCKXHtml._RemoveAttribute( node, FCKRegexLib.FCK_Class, 'class' ) ;
 
-		FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
+		node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
 
 		return node ;
@@ -429,5 +429,5 @@
 		}
 
-		FCKXHtml._AppendChildNodes( node, htmlNode ) ;
+		node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
 		return node ;
@@ -440,5 +440,5 @@
 			return false ;
 
-		FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
+		node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
 
 		return node ;
Index: /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckxhtml_ie.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckxhtml_ie.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/_source/internals/fckxhtml_ie.js	(revision 225)
@@ -98,5 +98,5 @@
 		node = FCKXHtml.XML.createDocumentFragment() ;
 
-	FCKXHtml._AppendChildNodes( node, htmlNode ) ;
+	node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
 	return node ;
@@ -124,5 +124,5 @@
 		FCKXHtml._AppendAttribute( node, 'selected', 'selected' ) ;
 
-	FCKXHtml._AppendChildNodes( node, htmlNode ) ;
+	node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
 	return node ;
@@ -154,5 +154,5 @@
 		FCKXHtml._AppendAttribute( node, 'for', htmlNode.htmlFor ) ;
 
-	FCKXHtml._AppendChildNodes( node, htmlNode ) ;
+	node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
 	return node ;
@@ -167,5 +167,5 @@
 		FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
 
-	FCKXHtml._AppendChildNodes( node, htmlNode ) ;
+	node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
 	return node ;
@@ -178,5 +178,5 @@
 		FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
 
-	FCKXHtml._AppendChildNodes( node, htmlNode ) ;
+	node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
 	return node ;
@@ -189,5 +189,5 @@
 		FCKXHtml._AppendAttribute( node, 'align', htmlNode.align ) ;
 
-	FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
+	node = FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
 
 	return node ;
Index: Keditor/branches/features/dataprocessor/editor/css/behaviors/hiddenfield.htc
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/css/behaviors/hiddenfield.htc	(revision 224)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<public:component lightweight="true">
-
-<public:attach event="oncontentready" onevent="ShowField()" />
-<public:attach event="ondoubleclick" onevent="EditField()" />
-
-<script language="javascript">
-
-var bIsHiddenField = this.type == 'hidden' ;
-
-function ShowField()
-{
-	if ( bIsHiddenField ) 
-	{
-		this.runtimeStyle.width				= '20px' ;
-		this.runtimeStyle.height			= '20px' ;
-		this.runtimeStyle.border			= '1px dotted #FF0000' ;
-		this.runtimeStyle.backgroundImage	= 'url(css/behaviors/hiddenfield.gif)' ;
-		this.runtimeStyle.fontSize			= '99px' ;
-	}
-}
-
-function EditField()
-{
-	if ( bIsHiddenField ) 
-		alert( this.outerHTML ) ;
-}
-
-</script>
-
-</public:component>
Index: /FCKeditor/branches/features/dataprocessor/editor/css/fck_internal.css
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/css/fck_internal.css	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/css/fck_internal.css	(revision 225)
@@ -26,5 +26,5 @@
 html
 {
-	min-height:100%;
+	min-height: 100%;
 }
 
@@ -70,5 +70,5 @@
 	background-image: url(images/fck_anchor.gif);
 	background-repeat: no-repeat;
-	padding-left:18px;
+	padding-left: 18px;
 }
 
@@ -81,5 +81,5 @@
 	background-image: url(images/fck_anchor.gif);
 	background-repeat: no-repeat;
-	padding-left:18px;
+	padding-left: 18px;
 }
 
@@ -100,17 +100,12 @@
 }
 
-input[type="hidden"]
+/* Hidden fields */
+.FCK__InputHidden
 {
-	display: inline;
-	width:20px;
-	height:20px;
-	border:1px dotted #FF0000 ;
-	background-image: url(behaviors/hiddenfield.gif);
+	width: 19px;
+	height: 18px;
+	background-image: url(images/fck_hiddenfield.gif);
 	background-repeat: no-repeat;
+	vertical-align: text-bottom;
+	background-position: center center;
 }
-
-input[type="hidden"]:after
-{
-	padding-left: 20px;
-	content: "" ;
-}
Index: /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_hiddenfield.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_hiddenfield.html	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_hiddenfield.html	(revision 225)
@@ -22,18 +22,29 @@
  * Hidden Field dialog window.
 -->
-<html>
-	<head>
-		<title>Hidden Field Properties</title>
-		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-		<meta content="noindex, nofollow" name="robots">
-		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
-		<script type="text/javascript">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Hidden Field Properties</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<meta content="noindex, nofollow" name="robots" />
+	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
+	<script type="text/javascript">
 
 var oEditor = window.parent.InnerDialogLoaded() ;
+var FCK = oEditor.FCK ;
 
 // Gets the document DOM
-var oDOM = oEditor.FCK.EditorDocument ;
+var oDOM = FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+// Get the selected flash embed (if available).
+var oFakeImage = FCK.Selection.GetSelectedElement() ;
+var oActiveEl ;
+
+if ( oFakeImage )
+{
+	if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckinputhidden') )
+		oActiveEl = FCK.GetRealElement( oFakeImage ) ;
+	else
+		oFakeImage = null ;
+}
 
 window.onload = function()
@@ -42,11 +53,9 @@
 	oEditor.FCKLanguageManager.TranslatePage(document) ;
 
-	if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'hidden' )
+	if ( oActiveEl )
 	{
 		GetE('txtName').value		= oActiveEl.name ;
 		GetE('txtValue').value		= oActiveEl.value ;
 	}
-	else
-		oActiveEl = null ;
 
 	window.parent.SetOkButton( true ) ;
@@ -58,7 +67,8 @@
 	if ( !oActiveEl )
 	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
+		oActiveEl = FCK.EditorDocument.createElement( 'INPUT' ) ;
 		oActiveEl.type = 'hidden' ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+
+		oFakeImage = null ;
 	}
 
@@ -66,30 +76,41 @@
 	SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 
+	if ( !oFakeImage )
+	{
+		oFakeImage	= oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__InputHidden', oActiveEl ) ;
+		oFakeImage.setAttribute( '_fckinputhidden', 'true', 0 ) ;
+		oFakeImage	= FCK.InsertElementAndGetIt( oFakeImage ) ;
+	}
+	else
+		oEditor.FCKUndo.SaveUndoStep() ;
+
+	oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oActiveEl ) ;
+
 	return true ;
 }
 
-		</script>
-	</head>
-	<body style="OVERFLOW: hidden" scroll="no">
-		<table height="100%" width="100%">
-			<tr>
-				<td align="center">
-					<table border="0" class="inhoud" cellpadding="0" cellspacing="0" width="80%">
-						<tr>
-							<td>
-								<span fckLang="DlgHiddenName">Name</span><br>
-								<input type="text" size="20" id="txtName" style="WIDTH: 100%">
-							</td>
-						</tr>
-						<tr>
-							<td>
-								<span fckLang="DlgHiddenValue">Value</span><br>
-								<input type="text" size="30" id="txtValue" style="WIDTH: 100%">
-							</td>
-						</tr>
-					</table>
-				</td>
-			</tr>
-		</table>
-	</body>
+	</script>
+</head>
+<body style="overflow: hidden" scroll="no">
+	<table height="100%" width="100%">
+		<tr>
+			<td align="center">
+				<table border="0" class="inhoud" cellpadding="0" cellspacing="0" width="80%">
+					<tr>
+						<td>
+							<span fcklang="DlgHiddenName">Name</span><br />
+							<input type="text" size="20" id="txtName" style="width: 100%" />
+						</td>
+					</tr>
+					<tr>
+						<td>
+							<span fcklang="DlgHiddenValue">Value</span><br />
+							<input type="text" size="30" id="txtValue" style="width: 100%" />
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</body>
 </html>
Index: /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_link/fck_link.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_link/fck_link.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_link/fck_link.js	(revision 225)
@@ -26,5 +26,5 @@
 var FCKLang		= oEditor.FCKLang ;
 var FCKConfig	= oEditor.FCKConfig ;
-var FCKRegexLib			= oEditor.FCKRegexLib ;
+var FCKRegexLib	= oEditor.FCKRegexLib ;
 
 //#### Dialog Tabs
@@ -56,26 +56,18 @@
 var oRegex = new Object() ;
 
-oRegex.UriProtocol = new RegExp('') ;
-oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ;
-
-oRegex.UrlOnChangeProtocol = new RegExp('') ;
-oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ;
-
-oRegex.UrlOnChangeTestOther = new RegExp('') ;
-//oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ;
-oRegex.UrlOnChangeTestOther.compile( '^((javascript:)|[#/\.])', 'gi' ) ;
-
-oRegex.ReserveTarget = new RegExp('') ;
-oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ;
-
-oRegex.PopupUri = new RegExp('') ;
-oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ;
-
-// Accesible popups
-oRegex.OnClickPopup = new RegExp('') ;
-oRegex.OnClickPopup.compile( "^\\s*onClick=\"\\s*window.open\\(\\s*this\\.href\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*;\\s*return\\s*false;*\\s*\"$" ) ;
-
-oRegex.PopupFeatures = new RegExp('') ;
-oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ;
+oRegex.UriProtocol = /^(((http|https|ftp|news):\/\/)|mailto:)/gi ;
+
+oRegex.UrlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/gi ;
+
+oRegex.UrlOnChangeTestOther = /^((javascript:)|[#\/\.])/gi ;
+
+oRegex.ReserveTarget = /^_(blank|self|top|parent)$/i ;
+
+oRegex.PopupUri = /^javascript:void\(\s*window.open\(\s*'([^']+)'\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*\)\s*$/ ;
+
+// Accessible popups
+oRegex.OnClickPopup = /^\s*on[cC]lick="\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*"$/ ;
+
+oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ;
 
 //#### Parser Functions
@@ -230,5 +222,5 @@
 	// Accesible popups, the popup data is in the onclick attribute
 	if ( !oPopupMatch ) {
-		var onclick = oLink.getAttribute( 'onClick_fckprotectedatt' ) ;
+		var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
 		oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ;
 		if( oPopupMatch )
@@ -554,5 +546,5 @@
 	if( GetE('cmbTarget').value == 'popup' )
 	{
-		SetAttribute( oLink, 'onClick_fckprotectedatt', " onClick=\"" + BuildOnClickPopup() + "\"") ;
+		SetAttribute( oLink, 'onclick_fckprotectedatt', " onclick=\"" + BuildOnClickPopup() + "\"") ;
 	}
 	else
@@ -560,7 +552,7 @@
 		// Check if the previous onclick was for a popup:
 		// In that case remove the onclick handler.
-		var onclick = oLink.getAttribute( 'onClick_fckprotectedatt' ) ;
+		var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
 		if( oRegex.OnClickPopup.test( onclick ) )
-			SetAttribute( oLink, 'onClick_fckprotectedatt', '' ) ;
+			SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ;
 	}
 
Index: /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_paste.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_paste.html	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/dialog/fck_paste.html	(revision 225)
@@ -203,6 +203,6 @@
 
 		// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
-		html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2</$1>' );
-		html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2</$1>' );
+		html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
+		html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
 	}
 	else
Index: /FCKeditor/branches/features/dataprocessor/editor/filemanager/browser/default/browser.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/filemanager/browser/default/browser.html	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/filemanager/browser/default/browser.html	(revision 225)
@@ -119,5 +119,5 @@
 oIcons.AvailableIconsArray = [
 	'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
-	'mdb','mp3','pdf','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
+	'mdb','mp3','pdf','png','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
 
 oIcons.AvailableIcons = new Object() ;
Index: /FCKeditor/branches/features/dataprocessor/editor/lang/_translationstatus.txt
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/lang/_translationstatus.txt	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/lang/_translationstatus.txt	(revision 225)
@@ -32,7 +32,7 @@
 de.js      Found: 401   Missing: 1
 el.js      Found: 401   Missing: 1
-en-au.js   Found: 401   Missing: 1
-en-ca.js   Found: 401   Missing: 1
-en-uk.js   Found: 401   Missing: 1
+en-au.js   Found: 402   Missing: 0
+en-ca.js   Found: 402   Missing: 0
+en-uk.js   Found: 402   Missing: 0
 eo.js      Found: 350   Missing: 52
 es.js      Found: 386   Missing: 16
@@ -56,7 +56,7 @@
 mn.js      Found: 230   Missing: 172
 ms.js      Found: 356   Missing: 46
-nb.js      Found: 401   Missing: 1
+nb.js      Found: 400   Missing: 2
 nl.js      Found: 401   Missing: 1
-no.js      Found: 401   Missing: 1
+no.js      Found: 400   Missing: 2
 pl.js      Found: 386   Missing: 16
 pt-br.js   Found: 401   Missing: 1
@@ -69,5 +69,5 @@
 sr.js      Found: 373   Missing: 29
 sv.js      Found: 381   Missing: 21
-th.js      Found: 350   Missing: 52
+th.js      Found: 398   Missing: 4
 tr.js      Found: 401   Missing: 1
 uk.js      Found: 401   Missing: 1
Index: /FCKeditor/branches/features/dataprocessor/editor/lang/en-au.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/lang/en-au.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/lang/en-au.js	(revision 225)
@@ -345,5 +345,5 @@
 
 DlgPasteMsg2	: "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.",
-DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",	//MISSING
+DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",
 DlgPasteIgnoreFont		: "Ignore Font Face definitions",
 DlgPasteRemoveStyles	: "Remove Styles definitions",
Index: /FCKeditor/branches/features/dataprocessor/editor/lang/en-ca.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/lang/en-ca.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/lang/en-ca.js	(revision 225)
@@ -345,5 +345,5 @@
 
 DlgPasteMsg2	: "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.",
-DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",	//MISSING
+DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",
 DlgPasteIgnoreFont		: "Ignore Font Face definitions",
 DlgPasteRemoveStyles	: "Remove Styles definitions",
Index: /FCKeditor/branches/features/dataprocessor/editor/lang/en-uk.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/lang/en-uk.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/lang/en-uk.js	(revision 225)
@@ -345,5 +345,5 @@
 
 DlgPasteMsg2	: "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.",
-DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",	//MISSING
+DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",
 DlgPasteIgnoreFont		: "Ignore Font Face definitions",
 DlgPasteRemoveStyles	: "Remove Styles definitions",
Index: /FCKeditor/branches/features/dataprocessor/editor/lang/nb.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/lang/nb.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/lang/nb.js	(revision 225)
@@ -501,4 +501,4 @@
 DlgAboutLicenseTab	: "Lisens",
 DlgAboutVersion		: "versjon",
-DlgAboutInfo		: "Oversatt av Siteman AS<br /><a target=\"_blank\" href=\"http://www.siteman.no\">www.siteman.no</a><br /><br />For mer informasjon gå til"
+DlgAboutInfo		: "For further information go to"	//MISSING
 };
Index: /FCKeditor/branches/features/dataprocessor/editor/lang/no.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/lang/no.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/lang/no.js	(revision 225)
@@ -501,4 +501,4 @@
 DlgAboutLicenseTab	: "Lisens",
 DlgAboutVersion		: "versjon",
-DlgAboutInfo		: "Oversatt av Siteman AS<br /><a target=\"_blank\" href=\"http://www.siteman.no\">www.siteman.no</a><br /><br />For mer informasjon gå til"
+DlgAboutInfo		: "For further information go to"	//MISSING
 };
Index: /FCKeditor/branches/features/dataprocessor/editor/lang/th.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/lang/th.js	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/lang/th.js	(revision 225)
@@ -48,6 +48,6 @@
 InsertImageLbl		: "รูปภาพ",
 InsertImage			: "แทรก/แก้ไข รูปภาพ",
-InsertFlashLbl		: "Flash",	//MISSING
-InsertFlash			: "Insert/Edit Flash",	//MISSING
+InsertFlashLbl		: "ไฟล์ Flash",
+InsertFlash			: "แทรก/แก้ไข ไฟล์ Flash",
 InsertTableLbl		: "ตาราง",
 InsertTable			: "แทรก/แก้ไข ตาราง",
@@ -90,6 +90,6 @@
 SpellCheck			: "ตรวจการสะกดคำ",
 UniversalKeyboard	: "คีย์บอร์ดหลากภาษา",
-PageBreakLbl		: "Page Break",	//MISSING
-PageBreak			: "Insert Page Break",	//MISSING
+PageBreakLbl		: "ใส่ตัวแบ่งหน้า Page Break",
+PageBreak			: "แทรกตัวแบ่งหน้า Page Break",
 
 Form			: "แบบฟอร์ม",
@@ -103,11 +103,11 @@
 ImageButton		: "ปุ่มแบบรูปภาพ",
 
-FitWindow		: "Maximize the editor size",	//MISSING
+FitWindow		: "ขยายขนาดตัวอีดิตเตอร์",
 
 // Context Menu
 EditLink			: "แก้ไข ลิงค์",
-CellCM				: "Cell",	//MISSING
-RowCM				: "Row",	//MISSING
-ColumnCM			: "Column",	//MISSING
+CellCM				: "ช่องตาราง",
+RowCM				: "แถว",
+ColumnCM			: "คอลัมน์",
 InsertRow			: "แทรกแถว",
 DeleteRows			: "ลบแถว",
@@ -118,9 +118,9 @@
 MergeCells			: "ผสานช่อง",
 SplitCell			: "แยกช่อง",
-TableDelete			: "Delete Table",	//MISSING
+TableDelete			: "ลบตาราง",
 CellProperties		: "คุณสมบัติของช่อง",
 TableProperties		: "คุณสมบัติของตาราง",
 ImageProperties		: "คุณสมบัติของรูปภาพ",
-FlashProperties		: "Flash Properties",	//MISSING
+FlashProperties		: "คุณสมบัติของไฟล์ Flash",
 
 AnchorProp			: "รายละเอียด Anchor",
@@ -146,7 +146,7 @@
 NotImplemented		: "ไม่สามารถใช้งานคำสั่งได้",
 UnknownToolbarSet	: "ไม่มีการติดตั้งชุดคำสั่งในแถบเครื่องมือ \"%1\" กรุณาติดต่อผู้ดูแลระบบ",
-NoActiveX			: "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.",	//MISSING
-BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",	//MISSING
-DialogBlocked		: "It was not possible to open the dialog window. Make sure all popup blockers are disabled.",	//MISSING
+NoActiveX			: "โปรแกรมท่องอินเตอร์เน็ตของท่านไม่อนุญาติให้อีดิตเตอร์ทำงาน \"Run ActiveX controls and plug-ins\". หากไม่อนุญาติให้ใช้งาน ActiveX controls ท่านจะไม่สามารถใช้งานได้อย่างเต็มประสิทธิภาพ.",
+BrowseServerBlocked : "เปิดหน้าต่างป๊อบอัพเพื่อทำงานต่อไม่ได้ กรุณาปิดเครื่องมือป้องกันป๊อบอัพในโปรแกรมท่องอินเตอร์เน็ตของท่านด้วย",
+DialogBlocked		: "เปิดหน้าต่างป๊อบอัพเพื่อทำงานต่อไม่ได้ กรุณาปิดเครื่องมือป้องกันป๊อบอัพในโปรแกรมท่องอินเตอร์เน็ตของท่านด้วย",
 
 // Dialogs
@@ -157,6 +157,6 @@
 DlgAdvancedTag		: "ขั้นสูง",
 DlgOpOther			: "<อื่นๆ>",
-DlgInfoTab			: "Info",	//MISSING
-DlgAlertUrl			: "Please insert the URL",	//MISSING
+DlgInfoTab			: "อินโฟ",
+DlgAlertUrl			: "กรุณาระบุ URL",
 
 // General Dialogs Labels
@@ -203,15 +203,15 @@
 DlgImgPreview		: "หน้าเอกสารตัวอย่าง",
 DlgImgAlertUrl		: "กรุณาระบุที่อยู่อ้างอิงออนไลน์ของไฟล์รูปภาพ (URL)",
-DlgImgLinkTab		: "Link",	//MISSING
+DlgImgLinkTab		: "ลิ้งค์",
 
 // Flash Dialog
-DlgFlashTitle		: "Flash Properties",	//MISSING
-DlgFlashChkPlay		: "Auto Play",	//MISSING
-DlgFlashChkLoop		: "Loop",	//MISSING
-DlgFlashChkMenu		: "Enable Flash Menu",	//MISSING
-DlgFlashScale		: "Scale",	//MISSING
-DlgFlashScaleAll	: "Show all",	//MISSING
-DlgFlashScaleNoBorder	: "No Border",	//MISSING
-DlgFlashScaleFit	: "Exact Fit",	//MISSING
+DlgFlashTitle		: "คุณสมบัติของไฟล์ Flash",
+DlgFlashChkPlay		: "เล่นอัตโนมัติ Auto Play",
+DlgFlashChkLoop		: "เล่นวนรอบ Loop",
+DlgFlashChkMenu		: "ให้ใช้งานเมนูของ Flash",
+DlgFlashScale		: "อัตราส่วน Scale",
+DlgFlashScaleAll	: "แสดงให้เห็นทั้งหมด Show all",
+DlgFlashScaleNoBorder	: "ไม่แสดงเส้นขอบ No Border",
+DlgFlashScaleFit	: "แสดงให้พอดีกับพื้นที่ Exact Fit",
 
 // Link Dialog
@@ -230,5 +230,5 @@
 DlgLnkAnchorByName	: "ชื่อ",
 DlgLnkAnchorById	: "ไอดี",
-DlgLnkNoAnchors		: "<ยังไม่มีจุดเชื่อมโยงภายในหน้าเอกสารนี้>",		//REVIEW : Change < and > with ( and )
+DlgLnkNoAnchors		: "(ยังไม่มีจุดเชื่อมโยงภายในหน้าเอกสารนี้)",		//REVIEW : Change < and > with ( and )
 DlgLnkEMail			: "อีเมล์ (E-Mail)",
 DlgLnkEMailSubject	: "หัวเรื่อง",
@@ -263,5 +263,5 @@
 DlnLnkMsgNoEMail	: "กรุณาระบุอีเมล์ (E-mail)",
 DlnLnkMsgNoAnchor	: "กรุณาระบุจุดเชื่อมโยง (Anchor)",
-DlnLnkMsgInvPopName	: "The popup name must begin with an alphabetic character and must not contain spaces",	//MISSING
+DlnLnkMsgInvPopName	: "ชื่อของหน้าต่างป๊อบอัพ จะต้องขึ้นต้นด้วยตัวอักษรเท่านั้น และต้องไม่มีช่องว่างในชื่อ",
 
 // Color Dialog
@@ -272,5 +272,5 @@
 
 // Smiley Dialog
-DlgSmileyTitle		: "แทรกสัญักษณ์สื่ออารมณ์",
+DlgSmileyTitle		: "แทรกสัญลักษณ์สื่ออารมณ์",
 
 // Special Character Dialog
@@ -294,5 +294,5 @@
 DlgTableCellPad		: "ระยะแนวตั้ง",
 DlgTableCaption		: "หัวเรื่องของตาราง",
-DlgTableSummary		: "Summary",	//MISSING
+DlgTableSummary		: "สรุปความ",
 
 // Table Cell Dialog
@@ -344,9 +344,9 @@
 PasteFromWord	: "วางแบบตัวอักษรจากโปรแกรมเวิร์ด",
 
-DlgPasteMsg2	: "Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.",	//MISSING
+DlgPasteMsg2	: "กรุณาใช้คีย์บอร์ดเท่านั้น โดยกดปุ๋ม (<strong>Ctrl และ V</strong>)พร้อมๆกัน และกด <strong>OK</strong>.",
 DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",	//MISSING
-DlgPasteIgnoreFont		: "Ignore Font Face definitions",	//MISSING
-DlgPasteRemoveStyles	: "Remove Styles definitions",	//MISSING
-DlgPasteCleanBox		: "Clean Up Box",	//MISSING
+DlgPasteIgnoreFont		: "ไม่สนใจ Font Face definitions",
+DlgPasteRemoveStyles	: "ลบ Styles definitions",
+DlgPasteCleanBox		: "ล้างข้อมูลใน Box",
 
 // Color Picker
@@ -382,7 +382,7 @@
 DlgButtonText		: "ข้อความ (ค่าตัวแปร)",
 DlgButtonType		: "ข้อความ",
-DlgButtonTypeBtn	: "Button",	//MISSING
-DlgButtonTypeSbm	: "Submit",	//MISSING
-DlgButtonTypeRst	: "Reset",	//MISSING
+DlgButtonTypeBtn	: "Button",
+DlgButtonTypeSbm	: "Submit",
+DlgButtonTypeRst	: "Reset",
 
 // Checkbox and Radio Button Dialogs
@@ -456,13 +456,13 @@
 DlgDocLangCode		: "รหัสภาษา",
 DlgDocCharSet		: "ชุดตัวอักษร",
-DlgDocCharSetCE		: "Central European",	//MISSING
-DlgDocCharSetCT		: "Chinese Traditional (Big5)",	//MISSING
-DlgDocCharSetCR		: "Cyrillic",	//MISSING
-DlgDocCharSetGR		: "Greek",	//MISSING
-DlgDocCharSetJP		: "Japanese",	//MISSING
-DlgDocCharSetKR		: "Korean",	//MISSING
-DlgDocCharSetTR		: "Turkish",	//MISSING
-DlgDocCharSetUN		: "Unicode (UTF-8)",	//MISSING
-DlgDocCharSetWE		: "Western European",	//MISSING
+DlgDocCharSetCE		: "Central European",
+DlgDocCharSetCT		: "Chinese Traditional (Big5)",
+DlgDocCharSetCR		: "Cyrillic",
+DlgDocCharSetGR		: "Greek",
+DlgDocCharSetJP		: "Japanese",
+DlgDocCharSetKR		: "Korean",
+DlgDocCharSetTR		: "Turkish",
+DlgDocCharSetUN		: "Unicode (UTF-8)",
+DlgDocCharSetWE		: "Western European",
 DlgDocCharSetOther	: "ชุดตัวอักษรอื่นๆ",
 
@@ -489,16 +489,16 @@
 
 // Templates Dialog
-Templates			: "Templates",	//MISSING
-DlgTemplatesTitle	: "Content Templates",	//MISSING
-DlgTemplatesSelMsg	: "Please select the template to open in the editor<br />(the actual contents will be lost):",	//MISSING
-DlgTemplatesLoading	: "Loading templates list. Please wait...",	//MISSING
-DlgTemplatesNoTpl	: "(No templates defined)",	//MISSING
-DlgTemplatesReplace	: "Replace actual contents",	//MISSING
+Templates			: "เทมเพลต",
+DlgTemplatesTitle	: "เทมเพลตของส่วนเนื้อหาเว็บไซต์",
+DlgTemplatesSelMsg	: "กรุณาเลือก เทมเพลต เพื่อนำไปแก้ไขในอีดิตเตอร์<br />(เนื้อหาส่วนนี้จะหายไป):",
+DlgTemplatesLoading	: "กำลังโหลดรายการเทมเพลตทั้งหมด...",
+DlgTemplatesNoTpl	: "(ยังไม่มีการกำหนดเทมเพลต)",
+DlgTemplatesReplace	: "แทนที่เนื้อหาเว็บไซต์ที่เลือก",
 
 // About Dialog
 DlgAboutAboutTab	: "เกี่ยวกับโปรแกรม",
 DlgAboutBrowserInfoTab	: "โปรแกรมท่องเว็บที่ท่านใช้",
-DlgAboutLicenseTab	: "License",	//MISSING
+DlgAboutLicenseTab	: "ลิขสิทธิ์",
 DlgAboutVersion		: "รุ่น",
-DlgAboutInfo		: "ข้อมูลเพิ่มเติมภาษาไทยติดต่อ</BR>นาย ชรินทร์ อาษากิจ (อู้ด)</BR><A HREF='mailto:arsakit@gmail.com'>arsakit@gmail.com</A> tel. (+66) 06-9241924</BR>หรือดาวน์โหลดรุ่นภาษาไทยได้ที่เว็บไซต์</BR><A HREF='http://www.thaimall4u.com'>www.Thaimall4u.com</A></BR>ข้อมูลเพิ่มเติมภาษาอังกฤษ กรุณาไปที่นี่"
+DlgAboutInfo		: "For further information go to"	//MISSING
 };
Index: /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/_sample/sample.config.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/_sample/sample.config.js	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/_sample/sample.config.js	(revision 225)
@@ -0,0 +1,26 @@
+﻿/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Sample custom configuration settings used by the BBCode plugin. It simply
+ * loads the plugin. All the rest is done by the plugin itself.
+ */
+
+// Add the BBCode plugin.
+FCKConfig.Plugins.Add( 'bbcode' ) ;
Index: /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/_sample/sample.html
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/_sample/sample.html	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/_sample/sample.html	(revision 225)
@@ -0,0 +1,67 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Sample page.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>FCKeditor - BBCode Sample</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<meta name="robots" content="noindex, nofollow" />
+	<link href="../../../../_samples/sample.css" rel="stylesheet" type="text/css" />
+	<script type="text/javascript" src="../../../../fckeditor.js"></script>
+</head>
+<body>
+	<h1>
+		FCKeditor - BBCode Sample</h1>
+	<p>
+		This is a sample of custom Data Processor implementation for (very) basic BBCode
+		syntax. Only <strong>[b]</strong>, <strong>[i]</strong>, <strong>[u]</strong> and
+		<strong>[url]</strong> may be used. It may be extended, but this is out of this
+		sample purpose.
+	</p>
+	<p>
+		Note that the input and output of the editor is not HTML, but BBCode
+	</p>
+	<hr />
+	<form action="../../../../_samples/html/sampleposteddata.asp" method="post" target="_blank">
+		<script type="text/javascript">
+<!--
+// Automatically calculates the editor base path based on the _samples directory.
+// This is usefull only for these samples. A real application should use something like this:
+// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
+var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('editor')) ;
+
+var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
+oFCKeditor.BasePath	= sBasePath ;
+
+// Set the custom configurations file path (in this way the original file is mantained).
+oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + 'editor/plugins/bbcode/_sample/sample.config.js' ;
+
+oFCKeditor.Value = 'This is some [b]sample text[/b]. You are using [url=http://www.fckeditor.net/]FCKeditor[/url].' ;
+oFCKeditor.Create() ;
+//-->
+		</script>
+		<br />
+		<input type="submit" value="Submit" />
+	</form>
+</body>
+</html>
Index: /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/fckplugin.js
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/fckplugin.js	(revision 225)
+++ /FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/fckplugin.js	(revision 225)
@@ -0,0 +1,121 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * This is a sample implementation for a custom Data Processor for basic BBCode.
+ */
+
+FCK.DataProcessor =
+{
+	/*
+	 * Returns a string representing the HTML format of "data". The returned
+	 * value will be loaded in the editor.
+	 * The HTML must be from <html> to </html>, eventually including
+	 * the DOCTYPE.
+	 *     @param {String} data The data to be converted in the
+	 *            DataProcessor specific format.
+	 */
+	ConvertToHtml : function( data )
+	{
+		// Convert < and > to their HTML entities.
+        data = data.replace( /</g, '&lt;' ) ;
+        data = data.replace( />/g, '&gt;' ) ;
+
+        // Convert line breaks to <br>.
+        data = data.replace( /(?:\r\n|\n|\r)/g, '<br>' ) ;
+
+        // [url]
+        data = data.replace( /\[url\](.+?)\[\/url]/gi, '<a href="$1">$1</a>' ) ;
+        data = data.replace( /\[url\=([^\]]+)](.+?)\[\/url]/gi, '<a href="$1">$2</a>' ) ;
+
+        // [b]
+        data = data.replace( /\[b\](.+?)\[\/b]/gi, '<b>$1</b>' ) ;
+
+        // [i]
+        data = data.replace( /\[i\](.+?)\[\/i]/gi, '<i>$1</i>' ) ;
+
+        // [u]
+        data = data.replace( /\[u\](.+?)\[\/u]/gi, '<u>$1</u>' ) ;
+
+		return '<html><head><title></title></head><body>' + data + '</body></html>' ;
+	},
+
+	/*
+	 * Converts a DOM (sub-)tree to a string in the data format.
+	 *     @param {Object} rootNode The node that contains the DOM tree to be
+	 *            converted to the data format.
+	 *     @param {Boolean} excludeRoot Indicates that the root node must not
+	 *            be included in the conversion, only its children.
+	 *     @param {Boolean} format Indicates that the data must be formatted
+	 *            for human reading. Not all Data Processors may provide it.
+	 */
+	ConvertToDataFormat : function( rootNode, excludeRoot, ignoreIfEmptyParagraph, format )
+	{
+		var data = rootNode.innerHTML ;
+
+		// Convert <br> to line breaks.
+		data = data.replace( /<br(?=[ \/>]).*?>/gi, '\r\n') ;
+
+		// [url]
+		data = data.replace( /<a .*?href=(["'])(.+?)\1.*?>(.+?)<\/a>/gi, '[url=$2]$3[/url]') ;
+
+		// [b]
+		data = data.replace( /<(?:b|strong)>/gi, '[b]') ;
+		data = data.replace( /<\/(?:b|strong)>/gi, '[/b]') ;
+
+		// [i]
+		data = data.replace( /<(?:i|em)>/gi, '[i]') ;
+		data = data.replace( /<\/(?:i|em)>/gi, '[/i]') ;
+
+		// [u]
+		data = data.replace( /<u>/gi, '[u]') ;
+		data = data.replace( /<\/u>/gi, '[/u]') ;
+
+		// Remove remaining tags.
+		data = data.replace( /<[^>]+>/g, '') ;
+
+		return data ;
+	},
+
+	/*
+	 * Makes any necessary changes to a piece of HTML for insertion in the
+	 * editor selection position.
+	 *     @param {String} html The HTML to be fixed.
+	 */
+	FixHtml : function( html )
+	{}
+} ;
+
+// This Data Processor doesn't support <p>, so let's use <br>.
+FCKConfig.EnterMode = 'br' ;
+
+// To avoid pasting invalid markup (which is discarded in any case), let's
+// force pasting to plain text.
+FCKConfig.ForcePasteAsPlainText	= true ;
+
+// Rename the "Source" buttom to "BBCode".
+FCKToolbarItems.RegisterItem( 'Source', new FCKToolbarButton( 'Source', 'BBCode', null, FCK_TOOLBARITEM_ICONTEXT, true, true, 1 ) ) ;
+
+// Let's enforce the toolbar to the limits of this Data Processor. A custom
+// toolbar set may be defined in the configuration file with more or less entries.
+FCKConfig.ToolbarSets["Default"] = [
+	['Source'],
+	['Bold','Italic','Underline','-','Link'],
+	['About']
+] ;
Index: /FCKeditor/branches/features/dataprocessor/editor/skins/default/fck_editor.css
===================================================================
--- /FCKeditor/branches/features/dataprocessor/editor/skins/default/fck_editor.css	(revision 224)
+++ /FCKeditor/branches/features/dataprocessor/editor/skins/default/fck_editor.css	(revision 225)
@@ -68,4 +68,5 @@
 .TB_Toolbar
 {
+	height: 24px;
     display: inline-table;	/* inline = Opera jumping buttons bug */
 }
