Skip to content

Commit

Permalink
resolves #25
Browse files Browse the repository at this point in the history
  • Loading branch information
natedrake committed Apr 2, 2017
1 parent 21e8404 commit 22e84a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,20 @@ public function parse()
$return.='<del>'.$element->value[1].'</del>';
break;
case 'text':
$return = '<p>'.$element->value[0].'</p>';
if (($this->previousElement) && (isset($this->elements[$key+1]))) {
/**
* @note logic for inline code blocks
*/
if ($this->elements[$key+1]->type() === 'code' && ($this->previousElement->type() !== 'code')) {
$return = '<p>'.$element->value[0];
} else if ($this->previousElement->type() === 'code' && $this->elements[$key+1]->type() === 'newline') {
$return=$element->value[0].'</p>';
} else if (($this->previousElement->type() === 'code' && $this->elements[$key+1]->type() === 'text') || ($this->previousElement->type() === 'code' && $this->elements[$key+1]->type() === 'code')) {
$return = $element->value[0];
} else {
$return='<p>'.$element->value[0].'</p>';
}
}
break;
default:
break;
Expand Down

0 comments on commit 22e84a3

Please sign in to comment.