Commit db546b79 authored by Pat Kira's avatar Pat Kira Committed by Robert Lyon

Remove extra <br> when shorten html (bug 1465107)

    task no. 23516

    Minor styling fixe:
    - remove border around tinymce resizable container
    - highlight submitted collection

    behatnotneeded

Change-Id: I0e5221d80008c425305860797b79a5d53848c533
parent 2045f77c
......@@ -3717,9 +3717,10 @@ function display_cleaned_html($html, $filename, $params) {
* @param int $maxlen The maximum length the new string should be (default 100)
* @param bool $truncate If true, cut the string at the end rather than in the middle (default false)
* @param bool $newlines If false, cut off after the first newline (default true)
* @param bool $usenl2br if false, only do HTML-escapes (default true)
* @return string
*/
function str_shorten_html($str, $maxlen=100, $truncate=false, $newlines=true) {
function str_shorten_html($str, $maxlen=100, $truncate=false, $newlines=true, $usenl2br=true) {
if (empty($str)) {
return $str;
}
......@@ -3757,7 +3758,11 @@ function str_shorten_html($str, $maxlen=100, $truncate=false, $newlines=true) {
$str = substr($str, 0, floor($maxlen / 2) - 1) . '...' . substr($str, -(floor($maxlen / 2) - 2), strlen($str));
}
}
$str = nl2br(hsc($str));
$str = hsc($str);
if ($usenl2br) {
$str = nl2br($str);
}
// this should be ok, because the string gets checked before going into the database
$str = str_replace('&amp;', '&', $str);
return $str;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,7 +5,7 @@
<a href="{group_homepage_url($item)}">{$item->name} <span class="metadata"> - {$item->roledisplay}</span></a>
{if $item->description}
<div class="details text-small mtm">
{$item->description|str_shorten_html:100:true|safe}
{$item->description|str_shorten_html:100:true:true:false|safe}
</div>
{/if}
</div>
......
......@@ -16,8 +16,8 @@
</a>
</h4>
<div class="ptl detail">
<p class="">
{$postinfo->body|str_shorten_html:100:true|safe}
<p>
{$postinfo->body|str_shorten_html:100:true:true:false|safe}
</p>
</div>
</li>
......
......@@ -17,7 +17,7 @@
</a>
</h4>
<div class="ptl detail">
<p class="">{$postinfo->body|str_shorten_html:100:true|safe}</p>
<p>{$postinfo->body|str_shorten_html:100:true:true:false|safe}</p>
</div>
</li>
......
......@@ -19,8 +19,6 @@
.mce-statusbar.mce-container{
margin-top: 5px;
background: $panel-info-heading-bg;
border: 1px solid $panel-info-border !important; //override inline
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,7 +9,7 @@
<div class="panel panel-default">
<div id="mycollections" class="list-group">
{foreach from=$collections item=collection}
<div class="list-group-item {cycle values='r0,r1'}">
<div class="list-group-item {cycle values='r0,r1'} {if $collection->submitinfo}list-group-item-warning{/if}">
{if $collection->views[0]->view}
<a href="{$collection->views[0]->fullurl}" class="outer-link"><span class="sr-only">{$collection->name}</span></a>
{/if}
......
......@@ -14,7 +14,7 @@
<div class="groupsdetails text-small">
<div class="mtm mbm">
{$group->description|str_shorten_html:100:true|safe}
{$group->description|str_shorten_html:100:true:true:false|safe}
</div>
{if $group->editwindow}
<div class="groupeditable detail">
......
......@@ -29,7 +29,7 @@
{if $r.role}
<div class="rel">
<div class="detail mts">
{$r.introduction|str_shorten_html:80:true|safe}
{$r.introduction|str_shorten_html:80:true:true:false|safe}
</div>
<div class="jointime detail mtm">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment