diff --git a/app/helpers.php b/app/helpers.php index 8d0649ac..bbdcdf7f 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -631,3 +631,18 @@ if (! function_exists('is_request_secure')) { return false; } } + +if (! function_exists('nl2p')) { + /** + * Wrap blocks of text (delimited by \n) in p tags (similar to nl2br). + * + * @param string $text + * @return string + */ + function nl2p($text) { + $parts = explode("\n", $text); + $result = '
'.implode('
', $parts).'
'; + // Remove empty paragraphs + return str_replace('', '', $result); + } +} diff --git a/resources/views/admin/update.blade.php b/resources/views/admin/update.blade.php index caf2121f..aae1975c 100644 --- a/resources/views/admin/update.blade.php +++ b/resources/views/admin/update.blade.php @@ -47,7 +47,7 @@{!! nl2br(trans('admin.update.cautions.text')) !!}
+ {!! nl2p(trans('admin.update.cautions.text')) !!}{{ $message }}
-{!! nl2br(trans('errors.exception.message')) !!}
+{!! nl2p(trans('errors.exception.message')) !!} @endsection diff --git a/resources/views/setup/updates/welcome.blade.php b/resources/views/setup/updates/welcome.blade.php index 4c9a8b13..db5ab1ed 100644 --- a/resources/views/setup/updates/welcome.blade.php +++ b/resources/views/setup/updates/welcome.blade.php @@ -6,7 +6,7 @@ @include('setup.wizard.language') -{!! nl2br(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}
+{!! nl2p(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}