summary refs log tree commit diff stats
path: root/web/babelpkglist.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-07-15 01:42:19 +0200
committerAndreas Rumpf <rumpf_a@web.de>2014-07-15 01:42:19 +0200
commit18ded6c23d72cd21fa0aa10ff61dc6f9af40832c (patch)
tree5d681c9835f01019e8ae83e14c0cd49d1a6c0d38 /web/babelpkglist.nim
parent687a1b7de4c006750274fb046a10f08d38c22f5a (diff)
parent41bb0bf9dcccdfcebdb0f823fea8b2853b89ea4e (diff)
downloadNim-18ded6c23d72cd21fa0aa10ff61dc6f9af40832c.tar.gz
Merge pull request #1363 from Araq/devel
Merge devel into master
Diffstat (limited to 'web/babelpkglist.nim')
-rw-r--r--web/babelpkglist.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/web/babelpkglist.nim b/web/babelpkglist.nim
index 378d4ce30..8745c9f99 100644
--- a/web/babelpkglist.nim
+++ b/web/babelpkglist.nim
@@ -28,13 +28,19 @@ proc processContent(content: string) =
     officialCount = 0
     unofficialList = ""
     unofficialCount = 0
+  let
+    endings = {'.', '!'}
 
   for pkg in jsonArr:
     assert pkg.kind == JObject
     let pkgWeb =
       if pkg.hasKey("web"): pkg["web"].str
       else: pkg["url"].str
-    let listItem = li(a(href=pkgWeb, pkg["name"].str), " ", pkg["description"].str)
+    let
+      desc = pkg["description"].str
+      # Review array index access when #1291 is solved.
+      dot = if desc.high > 0 and desc[<desc.high] in endings: "" else: "."
+      listItem = li(a(href=pkgWeb, pkg["name"].str), " ", desc & dot)
     if pkg["url"].str.startsWith("git://github.com/nimrod-code") or
        "official" in pkg["tags"].elems:
       officialCount.inc