Add helper function nl2p
This commit is contained in:
parent
ca8a01aced
commit
79bcff0d26
|
|
@ -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 = '<p>'.implode('</p><p>', $parts).'</p>';
|
||||
// Remove empty paragraphs
|
||||
return str_replace('<p></p>', '', $result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<tr>
|
||||
<td class="key">{{ trans('admin.update.info.change-log.text') }}</td>
|
||||
<td class="value">
|
||||
{!! nl2br($info['release_note']) ?: trans('admin.update.info.change-log.empty') !!}
|
||||
{!! nl2p($info['release_note']) ?: trans('admin.update.info.change-log.empty') !!}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
<h3 class="box-title">{{ trans('admin.update.cautions.title') }}</h3>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<p>{!! nl2br(trans('admin.update.cautions.text')) !!}</p>
|
||||
{!! nl2p(trans('admin.update.cautions.text')) !!}
|
||||
</div><!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
<p>{{ $message }}</p>
|
||||
|
||||
<p>{!! nl2br(trans('errors.exception.message')) !!}</p>
|
||||
{!! nl2p(trans('errors.exception.message')) !!}
|
||||
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
@include('setup.wizard.language')
|
||||
</h1>
|
||||
|
||||
<p>{!! nl2br(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}</p>
|
||||
{!! nl2p(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}
|
||||
|
||||
<form method="post" action="" novalidate="novalidate">
|
||||
<p class="step">
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<?php list($from, $to) = explode(',', Option::get('sign_score')); ?>
|
||||
{!! nl2br(trans('user.score-intro.introduction', [
|
||||
{!! nl2p(trans('user.score-intro.introduction', [
|
||||
'initial_score' => option('user_initial_score'),
|
||||
'score-from' => $from,
|
||||
'score-to' => $to,
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@
|
|||
<h4 class="modal-title">{{ trans('user.profile.delete.modal-title') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{!! nl2br(trans('user.profile.delete.modal-notice')) !!}
|
||||
{!! nl2p(trans('user.profile.delete.modal-notice')) !!}
|
||||
<br />
|
||||
<input type="password" class="form-control" id="password" placeholder="{{ trans('user.profile.delete.password') }}">
|
||||
<br />
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user