Skip to content

Commit 6ede407

Browse files
authored
Merge pull request #729 from haskell/gb/change-breaking
whitespace changes
2 parents dd5dbb6 + 926adcc commit 6ede407

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

Distribution/Server/Pages/Package.hs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,23 +353,19 @@ showDependencies :: [Dependency] -> Html
353353
showDependencies deps = commaList (map showDependency deps)
354354

355355
showDependency :: Dependency -> Html
356-
showDependency (Dependency (unPackageName -> pname) vs) = showPkg +++ vsHtml
356+
showDependency (Dependency (unPackageName -> pname) vs) = nonbreakingSpan << (showPkg +++ vsHtml)
357357
where vsHtml = if vs == anyVersion then noHtml
358-
else nonbreakingHtml (" (" ++ display vs ++ ")")
358+
else toHtml (" (" ++ display vs ++ ")")
359359
-- mb_vers links to latest version in range. This is a bit computationally
360360
-- expensive, not cache-friendly, and perhaps unexpected in some cases
361361
{-mb_vers = maybeLast $ filter (`withinRange` vs) $ map packageVersion $
362362
PackageIndex.lookupPackageName vmap (PackageName pname)-}
363363
-- nonetheless, we should ensure that the package exists /before/
364364
-- passing along the PackageRender, which is not the case here
365-
showPkg = anchor ! [href . packageURL $ PackageIdentifier (mkPackageName pname) nullVersion] << nonbreakingHtml pname
366-
367-
nonbreakingHtml :: String -> Html
368-
nonbreakingHtml = primHtml . concatMap htmlizeChar2 . stringToHtmlString
369-
where
370-
htmlizeChar2 ' ' = "&nbsp;"
371-
htmlizeChar2 '-' = "&#8209;"
372-
htmlizeChar2 c = [c]
365+
showPkg = anchor ! [href . packageURL $ PackageIdentifier (mkPackageName pname) nullVersion] << pname
366+
367+
nonbreakingSpan :: Html -> Html
368+
nonbreakingSpan str = thespan ! [thestyle "white-space: nowrap"] << str
373369

374370
renderDetailedDependencies :: PackageRender -> Html
375371
renderDetailedDependencies pkgRender =

datafiles/templates/Html/package-page.html.st

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@
5656

5757
<tr>
5858
<th>License</th>
59-
<td>$package.license$</td>
59+
<td class="word-wrap">$package.license$</td>
6060
</tr>
6161

6262
$if(package.optional.hasCopyright)$
6363
<tr>
6464
<th>Copyright</th>
65-
<td>$package.optional.copyright$</td>
65+
<td class="word-wrap">$package.optional.copyright$</td>
6666
</tr>
6767
$endif$
6868

6969
<tr>
7070
<th>Author</th>
71-
<td>$package.author$</td>
71+
<td class="word-wrap">$package.author$</td>
7272
</tr>
7373
<tr>
7474
<th>Maintainer</th>
75-
<td>$package.maintainer$</td>
75+
<td class="word-wrap">$package.maintainer$</td>
7676
</tr>
7777

7878
$if(hackage.hasUpdateTime)$

0 commit comments

Comments
 (0)