X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fhtmlparser%2Ftext.js;fp=_source%2Fcore%2Fhtmlparser%2Ftext.js;h=718bd8228779bfe9c257e198cca028626f1adc41;hb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;hp=0000000000000000000000000000000000000000;hpb=b93873b6532ee7515fb0d6f8b73176c44fad28f7;p=ckeditor.git diff --git a/_source/core/htmlparser/text.js b/_source/core/htmlparser/text.js new file mode 100644 index 0000000..718bd82 --- /dev/null +++ b/_source/core/htmlparser/text.js @@ -0,0 +1,55 @@ +/* +Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + var spacesRegex = /[\t\r\n ]{2,}|[\t\r\n]/g; + + /** + * A lightweight representation of HTML text. + * @constructor + * @example + */ + CKEDITOR.htmlParser.text = function( value ) + { + /** + * The text value. + * @type String + * @example + */ + this.value = value; + + /** @private */ + this._ = + { + isBlockLike : false + }; + }; + + CKEDITOR.htmlParser.text.prototype = + { + /** + * The node type. This is a constant value set to {@link CKEDITOR.NODE_TEXT}. + * @type Number + * @example + */ + type : CKEDITOR.NODE_TEXT, + + /** + * Writes the HTML representation of this text to a CKEDITOR.htmlWriter. + * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. + * @example + */ + writeHtml : function( writer, filter ) + { + var text = this.value; + + if ( filter && !( text = filter.onText( text, this ) ) ) + return; + + writer.text( text ); + } + }; +})();