Skip to content

Commit

Permalink
Add try catch around everything of tag when rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
qurben committed Jan 30, 2021
1 parent 7d1bf03 commit 7231293
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,24 @@ public function render($blocks, $mode)
$text = '';

foreach ($blocks as $block) {
if ($block->isAllowed()) {
$block->setContent($this->render($block->getChildren(), $mode));
try {
if ($block->isAllowed()) {
$block->setContent($this->render($block->getChildren(), $mode));

try {
if ($mode == "light") {
$text .= $block->renderLight();
} elseif ($mode == "plain") {
$text .= $block->renderPlain();
} else {
$text .= $block->render();
}
} catch (BbException $exception) {
$text .= $exception->getMessage();
} else {
$text .= '';
}
} else {
$text .= '';
} catch (BbException $exception) {
$text .= $exception->getMessage();
}
}
}

return $text;
}
Expand Down

0 comments on commit 7231293

Please sign in to comment.