diff --git a/lib/document/TextBox.js b/lib/document/TextBox.js index 19e68e55..c05d97d0 100644 --- a/lib/document/TextBox.js +++ b/lib/document/TextBox.js @@ -98,6 +98,7 @@ function TextBox( options ) { this.initChildren() ; + this.contentHasMarkup = options.contentHasMarkup ; if ( this.setContent === TextBox.prototype.setContent ) { this.setContent( options.content , options.contentHasMarkup , true ) ; } @@ -401,7 +402,6 @@ TextBox.prototype.getContent = function() { return this.textBuffer.getText() ; } TextBox.prototype.setContent = function( content , hasMarkup , dontDraw ) { - var contentSize ; if ( typeof content !== 'string' ) { if ( content === null || content === undefined ) { content = '' ; } @@ -409,9 +409,11 @@ TextBox.prototype.setContent = function( content , hasMarkup , dontDraw ) { } this.content = content ; - this.contentHasMarkup = hasMarkup ; + if (hasMarkup === undefined) { + hasMarkup = this.contentHasMarkup ; + } - this.textBuffer.setText( this.content , this.contentHasMarkup , this.textAttr ) ; + this.textBuffer.setText( content , hasMarkup , this.textAttr ) ; if ( this.stateMachine ) { this.textBuffer.runStateMachine() ;