CKEditor 4 Documentation

CKEDITOR.htmlParser.basicWriter

Subclasses

Files

TODO

Defined By

Methods

Creates a basicWriter class instance. ...

Creates a basicWriter class instance.

Returns

CKEDITOR.htmlParser.basicWriter
view source
( attName, attValue )
Writes an attribute. ...

Writes an attribute. This function should be called after opening the tag with openTagClose.

// Writes ' class="MyClass"'.
writer.attribute( 'class', 'MyClass' );

Parameters

  • attName : String

    The attribute name.

  • attValue : String

    The attribute value.

CKEDITOR.htmlParser.basicWriter
view source
( tagName )
Writes a closer tag. ...

Writes a closer tag.

// Writes '</p>'.
writer.closeTag( 'p' );

Parameters

  • tagName : String

    The element name for this tag.

CKEDITOR.htmlParser.basicWriter
view source
( comment )
Writes a comment. ...

Writes a comment.

// Writes '<!-- My comment -->'.
writer.comment( ' My comment ' );

Parameters

  • comment : String

    The comment text.

CKEDITOR.htmlParser.basicWriter
view source
( reset ) : String
Empties the current output buffer. ...

Empties the current output buffer.

var html = writer.getHtml();

Parameters

  • reset : Boolean

    Indicates that the reset method is to be automatically called after retrieving the HTML.

Returns

  • String

    The HTML written to the writer so far.

CKEDITOR.htmlParser.basicWriter
view source
( tagName, attributes )
Writes the tag opening part for a opener tag. ...

Writes the tag opening part for a opener tag.

// Writes '<p'.
writer.openTag( 'p', { class : 'MyClass', id : 'MyId' } );

Parameters

  • tagName : String

    The element name for this tag.

  • attributes : Object

    The attributes defined for this tag. The attributes could be used to inspect the tag.

CKEDITOR.htmlParser.basicWriter
view source
( tagName, isSelfClose )
Writes the tag closing part for a opener tag. ...

Writes the tag closing part for a opener tag.

// Writes '>'.
writer.openTagClose( 'p', false );

// Writes ' />'.
writer.openTagClose( 'br', true );

Parameters

  • tagName : String

    The element name for this tag.

  • isSelfClose : Boolean

    Indicates that this is a self-closing tag, like <br> or <img>.

CKEDITOR.htmlParser.basicWriter
view source
( )
Empties the current output buffer. ...

Empties the current output buffer.

writer.reset();
CKEDITOR.htmlParser.basicWriter
view source
( text )
Writes text. ...

Writes text.

// Writes 'Hello Word'.
writer.text( 'Hello Word' );

Parameters

  • text : String

    The text value.

CKEDITOR.htmlParser.basicWriter
view source
( data )
Writes any kind of data to the ouput. ...

Writes any kind of data to the ouput.

writer.write( 'This is an <b>example</b>.' );

Parameters

  • data : String