From 1e320bc8c5112b152ebc3092331b8b1fe0ae5191 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Sun, 6 Dec 2020 16:54:32 +0800 Subject: [docs minor]space for code-block (#16266) * [docs minor]space for code-block * correct more errors * to runnableExamples * add newline --- lib/pure/unidecode/unidecode.nim | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'lib/pure/unidecode/unidecode.nim') 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) -- cgit 1.4.1-2-gfad0