Skip to content
Snippets Groups Projects
Commit 7c15eaa2 authored by Anika Henke's avatar Anika Henke
Browse files

Fix invalid HTML in search results

Recent changes to the search results page added various divs
to the pre-existing description list, which is invalid.
This fixes that by a) removing a couple of unnecessary elements
and b) interpret the 'last modified' line as another 'dd'.
parent 5d021066
No related branches found
No related tags found
No related merge requests found
......@@ -584,18 +584,16 @@ class Search extends Ui
if ($cnt !== 0) {
$resultHeader[] = $cnt . ' ' . $lang['hits'];
if ($num < FT_SNIPPET_NUMBER) { // create snippets for the first number of matches only
$snippet = '<dd>' . ft_snippet($id, $highlight) . '</dd>';
$lastMod = '<span class="search_results__lastmod">' . $lang['lastmod'] . ' ';
$snippet = '<dd class="snippet">' . ft_snippet($id, $highlight) . '</dd>';
$lastMod = $lang['lastmod'] . ' ';
$lastMod .= '<time datetime="' . date_iso8601($mtime) . '" title="'.dformat($mtime).'">' . dformat($mtime, '%f') . '</time>';
$lastMod .= '</span>';
}
$num++;
}
$metaLine = '<div class="search_results__metaLine">';
$metaLine = '<dd class="lastmod">';
$metaLine .= $lastMod;
$metaLine .= '</div>';
$metaLine .= '</dd>';
$eventData = [
'resultHeader' => $resultHeader,
......@@ -603,10 +601,8 @@ class Search extends Ui
'page' => $id,
];
trigger_event('SEARCH_RESULT_FULLPAGE', $eventData);
$html .= '<div class="search_fullpage_result">';
$html .= '<dt>' . implode(' ', $eventData['resultHeader']) . '</dt>';
$html .= implode('', $eventData['resultBody']);
$html .= '</div>';
}
$html .= '</dl>';
......
......@@ -136,8 +136,13 @@
margin-bottom: .2em;
}
/* last modified line */
dd.lastmod {
margin: 0 0 .2em 0;
}
/* search snippet */
dd {
dd.snippet {
color: @ini_text_alt;
background-color: inherit;
margin: 0 0 1.2em 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment