JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / core / htmlparser / text.js
1 /*\r
2 Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license\r
4 */\r
5 \r
6 (function()\r
7 {\r
8         /**\r
9          * A lightweight representation of HTML text.\r
10          * @constructor\r
11          * @example\r
12          */\r
13         CKEDITOR.htmlParser.text = function( value )\r
14         {\r
15                 /**\r
16                  * The text value.\r
17                  * @type String\r
18                  * @example\r
19                  */\r
20                 this.value = value;\r
21 \r
22                 /** @private */\r
23                 this._ =\r
24                 {\r
25                         isBlockLike : false\r
26                 };\r
27         };\r
28 \r
29         CKEDITOR.htmlParser.text.prototype =\r
30         {\r
31                 /**\r
32                  * The node type. This is a constant value set to {@link CKEDITOR.NODE_TEXT}.\r
33                  * @type Number\r
34                  * @example\r
35                  */\r
36                 type : CKEDITOR.NODE_TEXT,\r
37 \r
38                 /**\r
39                  * Writes the HTML representation of this text to a CKEDITOR.htmlWriter.\r
40                  * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.\r
41                  * @example\r
42                  */\r
43                 writeHtml : function( writer, filter )\r
44                 {\r
45                         var text = this.value;\r
46 \r
47                         if ( filter && !( text = filter.onText( text, this ) ) )\r
48                                 return;\r
49 \r
50                         writer.text( text );\r
51                 }\r
52         };\r
53 })();\r