protected function doParagraphReally() { if ($this->paragraphContainsBlockImage()) { $this->saveStartTag($this->blockImageElement, array('class' => 'image')); $this->inParagraph(); $this->saveEndTag($this->blockImageElement); } else { parent::doParagraphReally(); } }