From 2aeb0d516b5e4cde1abb68a0c0d5393cf8c65915 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 4 Aug 2022 14:49:51 +0800 Subject: fixes #20132; fixes the broken jsondoc comand [backport] (#20135) * fixes #20132; fixes the broken jsondoc comand * add testcase --- compiler/docgen.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 0ca1b8c52..52bb93c19 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -1360,9 +1360,10 @@ proc finishGenerateDoc*(d: var PDoc) = var str: string renderRstToOut(d[], resolved, str) entry.json[entry.rstField] = %str - d.jEntriesFinal.add entry.json d.jEntriesPre[i].rst = nil + d.jEntriesFinal.add entry.json # generates docs + proc add(d: PDoc; j: JsonItem) = if j.json != nil or j.rst != nil: d.jEntriesPre.add j -- cgit 1.4.1-2-gfad0