]>
git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/core/htmlparser/text.js
07cb865822d0ed7b3a7796919cc6a420bc845c2b
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
10 * A lightweight representation of HTML text.
13 * @extends CKEDITOR.htmlParser.node
14 * @constructor Creates a text class instance.
15 * @param {String} value The text node value.
17 CKEDITOR
.htmlParser
.text = function( value
) {
31 CKEDITOR
.htmlParser
.text
.prototype = CKEDITOR
.tools
.extend( new CKEDITOR
.htmlParser
.node(), {
33 * The node type. This is a constant value set to {@link CKEDITOR#NODE_TEXT}.
36 * @property {Number} [=CKEDITOR.NODE_TEXT]
38 type: CKEDITOR
.NODE_TEXT
,
41 * Filter this text node with given filter.
44 * @param {CKEDITOR.htmlParser.filter} filter
45 * @returns {Boolean} Method returns `false` when this text node has
46 * been removed. This is an information for {@link CKEDITOR.htmlParser.element#filterChildren}
47 * that it has to repeat filter on current position in parent's children array.
49 filter: function( filter
, context
) {
50 if ( !( this.value
= filter
.onText( context
, this.value
, this ) ) ) {
57 * Writes the HTML representation of this text to a {CKEDITOR.htmlParser.basicWriter}.
59 * @param {CKEDITOR.htmlParser.basicWriter} writer The writer to which write the HTML.
60 * @param {CKEDITOR.htmlParser.filter} [filter] The filter to be applied to this node.
61 * **Note:** it's unsafe to filter offline (not appended) node.
63 writeHtml: function( writer
, filter
) {
65 this.filter( filter
);
67 writer
.text( this.value
);