diff options
author | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2014-06-21 12:53:08 +0200 |
---|---|---|
committer | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2014-06-21 13:13:48 +0200 |
commit | e21999c2c684eba39c399b8a775d07167035587e (patch) | |
tree | 8ea19b0bc9888b87e3203527d95c4d2817f4020d /web/babelpkglist.nim | |
parent | be534279da5021aa5e6621430a52ee1573f1a01f (diff) | |
download | Nim-e21999c2c684eba39c399b8a775d07167035587e.tar.gz |
Forces babel package descriptions to end with a dot.
Diffstat (limited to 'web/babelpkglist.nim')
-rw-r--r-- | web/babelpkglist.nim | 8 |
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 |