Skip to content
Permalink
Browse files

Merge branch 't/10148b' into major

  • Loading branch information
Reinmar committed Mar 5, 2013
2 parents c321667 + 3e7fc86 commit 6e1a635f4bb0c16edae11cf2d86326ad2958922e
Showing with 26 additions and 10 deletions.
  1. +10 −3 core/editable.js
  2. +1 −0 core/editor.js
  3. +2 −2 core/filter.js
  4. +8 −3 core/htmldataprocessor.js
  5. +5 −2 core/htmlparser/fragment.js
@@ -157,7 +157,7 @@
insertHtml: function( data, mode ) {
beforeInsert( this );
// Default mode is 'html'.
insert( this, mode == 'text' ? 'text' : 'html', data );
insert( this, mode || 'html', data );
},

/**
@@ -968,7 +968,13 @@
// Note: getRanges will be overwritten for tests since we want to test
// custom ranges and bypass native selections.
// TODO what should we do with others? Remove?
range = selection.getRanges()[ 0 ];
range = selection.getRanges()[ 0 ],
dontFilter = false;

if ( type == 'unfiltered_html' ) {
type = 'html';
dontFilter = true;
}

// Check range spans in non-editable.
if ( range.checkReadOnly() )
@@ -983,6 +989,7 @@
// The "state" value.
that = {
type: type,
dontFilter: dontFilter,
editable: editable,
editor: editor,
range: range,
@@ -1124,7 +1131,7 @@
// Process the inserted html, in context of the insertion root.
// Don't use the "fix for body" feature as auto paragraphing must
// be handled during insertion.
data = that.editor.dataProcessor.toHtml( data, null, false );
data = that.editor.dataProcessor.toHtml( data, null, false, that.dontFilter );


// Build the node list for insertion.
@@ -841,6 +841,7 @@
*
* * `"html"` - content being inserted will completely override styles
* of selected position.
* * `"unfiltered_html"` - like `"html"` but content isn't filtered with {@link CKEDITOR.filter}.
* * `"text"` - content being inserted will inherit styles applied in
* selected position. This mode should be used when inserting "htmlified" plain text
* (HTML without inline styles and styling elements like
@@ -145,7 +145,7 @@
// Add element filter before htmlDataProcessor.dataFilter
// when purifying input data to correct html.
this._.toHtmlListener = editor.on( 'toHtml', function( evt ) {
this.applyTo( evt.data.dataValue, true );
this.applyTo( evt.data.dataValue, true, evt.data.dontFilter );
}, this, null, 6 );

// Transform outcoming "data".
@@ -1901,4 +1901,4 @@
/**
* @method toFeature
* @returns {CKEDITOR.feature}
*/
*/
@@ -149,10 +149,13 @@
* @param {String} data The raw data.
* @param {String} [context] The tag name of a context element within which
* the input is to be processed, default to be the editable element.
* If `null` is passed, then data will be parsed without context (as children of {@link CKEDITOR.htmlParser.fragment}).
* See {@link CKEDITOR.htmlParser.fragment#fromHtml} for more details.
* @param {Boolean} [fixForBody] Whether trigger the auto paragraph for non-block contents.
* @param {Boolean} [dontFilter] Don't filter data with {@link CKEDITOR.filter}.
* @returns {String}
*/
toHtml: function( data, context, fixForBody ) {
toHtml: function( data, context, fixForBody, dontFilter ) {
var editor = this.editor;

// Fall back to the editable as context if not specified.
@@ -162,7 +165,8 @@
return editor.fire( 'toHtml', {
dataValue: data,
context: context,
fixForBody: fixForBody
fixForBody: fixForBody,
dontFilter: !!dontFilter
} ).dataValue;
},

@@ -822,7 +826,8 @@
* @param data
* @param {String/CKEDITOR.htmlParser.fragment/CKEDITOR.htmlParser.element} data.dataValue Input data to be purified.
* @param {String} data.context See {@link CKEDITOR.htmlDataProcessor#toHtml} `context` argument.
* @param {String} data.fixForBody See {@link CKEDITOR.htmlDataProcessor#toHtml} `fixForBody` argument.
* @param {Bolean} data.fixForBody See {@link CKEDITOR.htmlDataProcessor#toHtml} `fixForBody` argument.
* @param {Boolean} data.dontFilter See {@link CKEDITOR.htmlDataProcessor#toHtml} `dontFilter` argument.
*/

/**
@@ -59,14 +59,17 @@ CKEDITOR.htmlParser.fragment = function() {
* @static
* @param {String} fragmentHtml The HTML to be parsed, filling the fragment.
* @param {CKEDITOR.htmlParser.element/String} [parent] Optional contextual
* element which makes the content been parsed as the content of this element.
* element which makes the content been parsed as the content of this element and fix
* to match it.
* If not provided, then {@link CKEDITOR.htmlParser.fragment} will be used
* as the parent and it will be returned.
* @param {String/Boolean} [fixingBlock] When `parent` is a block limit element,
* and the param is a string value other than `false`, it is to
* avoid having block-less content as the direct children of parent by wrapping
* the content with a block element of the specified tag, e.g.
* when `fixingBlock` specified as `p`, the content `<body><i>foo</i></body>`
* will be fixed into `<body><p><i>foo</i></p></body>`.
* @returns CKEDITOR.htmlParser.fragment The fragment created.
* @returns {CKEDITOR.htmlParser.fragment/CKEDITOR.htmlParser.element} The created fragment or passed `parent`.
*/
CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml, parent, fixingBlock ) {
var parser = new CKEDITOR.htmlParser();

0 comments on commit 6e1a635

Please sign in to comment.
You can’t perform that action at this time.