Report an issue
Class

CKEDITOR.htmlParser.basicWriter

class

Filtering

Methods

  • constructor() → basicWriter

    Creates a basicWriter class instance.

    Returns

    basicWriter
  • attribute( attName, attValue )

    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.

  • closeTag( tagName )

    Writes a closer tag.

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

    Parameters

    tagName : String

    The element name for this tag.

  • comment( comment )

    Writes a comment.

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

    Parameters

    comment : String

    The comment text.

  • getHtml( reset ) → String

    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.

  • openTag( tagName, attributes )

    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.

  • openTagClose( tagName, isSelfClose )

    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>.

  • reset()

    Empties the current output buffer.

    writer.reset();
    
  • text( text )

    Writes text.

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

    Parameters

    text : String

    The text value.

  • write( data )

    Writes any kind of data to the ouput.

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

    Parameters

    data : String