Skip to content

Commit 3ba1d13

Browse files
Merge pull request #19 from The-3Labs-Team/Fix-Bladerender()-if-not-valid-HTML
Fix bladerender() if not valid html
2 parents 224ac2e + f4d15f9 commit 3ba1d13

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AdsPostParser.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ public function appendSingleAdvertising(int $index, int $advIndex): string
6262
! preg_match($this->blacklistBefore, $beforeItem->outertext)
6363
&& ($nextItem === null || ! preg_match($this->blacklistAfter, $nextItem->outertext))
6464
) {
65-
$beforeItem->outertext .= Blade::render('ads-post-parser::ads'.$advIndex);
65+
try {
66+
$beforeItem->outertext .= Blade::render('ads-post-parser::ads'.$advIndex);
67+
} catch (\Exception $e) {
68+
// Content without ADV
69+
}
70+
6671
} else {
6772
$this->appendSingleAdvertising($index + 1, $advIndex);
6873
}

0 commit comments

Comments
 (0)