summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-06 16:54:32 +0800
committerGitHub <noreply@github.com>2020-12-06 09:54:32 +0100
commit1e320bc8c5112b152ebc3092331b8b1fe0ae5191 (patch)
tree9bc4b4d4732101cc03df813b96626718a5016cb4 /lib
parent48d7c40553f0769c22b4b47f8079dd96c3e23323 (diff)
downloadNim-1e320bc8c5112b152ebc3092331b8b1fe0ae5191.tar.gz
[docs minor]space for code-block (#16266)
* [docs minor]space for code-block

* correct more errors

* to runnableExamples

* add newline
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/unidecode/unidecode.nim12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/pure/unidecode/unidecode.nim b/lib/pure/unidecode/unidecode.nim
index 9a10ccc00..166608aeb 100644
--- a/lib/pure/unidecode/unidecode.nim
+++ b/lib/pure/unidecode/unidecode.nim
@@ -52,15 +52,9 @@ proc loadUnidecodeTable*(datafile = "unidecode.dat") =
 proc unidecode*(s: string): string =
   ## Finds the sequence of ASCII characters that is the closest approximation
   ## to the UTF-8 string `s`.
-  ##
-  ## Example:
-  ##
-  ## ..code-block:: nim
-  ##
-  ##   unidecode("北京")
-  ##
-  ## Results in: "Bei Jing"
-  ##
+  runnableExamples:
+    assert unidecode("北京") == "Bei Jing "
+
   result = ""
   for r in runes(s):
     var c = int(r)