Skip to content

Commit

Permalink
Added catch for Html2Text in case the HTML is unable to be parsed for…
Browse files Browse the repository at this point in the history
… some reason
  • Loading branch information
Raikia committed Jun 13, 2017
1 parent aed879c commit e6c32e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion resources/views/layouts/email_plaintext.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
{!! Html2Text\Html2Text::convert(preg_replace('/(<[^>]+) id=".*?"/i', '$1', $data)) !!}
@php
try {
echo Html2Text\Html2Text::convert(preg_replace('/(<[^>]+) id=".*?"/i', '$1', $data));
} catch (\Exception $e) {
echo strip_tags($data);
}
@endphp

0 comments on commit e6c32e8

Please sign in to comment.