From ebf7b2bb3a4e85c4ddc8f1422dc3e1b52387f89c Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Wed, 13 May 2020 20:02:46 -0600 Subject: [PATCH] Change comments to markdown block --- nimterop/tshelp.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nimterop/tshelp.nim b/nimterop/tshelp.nim index 762cf7c..2eedcc6 100644 --- a/nimterop/tshelp.nim +++ b/nimterop/tshelp.nim @@ -269,12 +269,13 @@ proc getCommentsStr*(gState: State, commentNodes: seq[TSNode]): string = ## Generate a comment from a set of comment nodes. Comment is guaranteed ## to be able to be rendered using nim doc if commentNodes.len > 0: - result = "::" + result = "```" for commentNode in commentNodes: result &= "\n " & gState.getNodeVal(commentNode).strip() result = result.replace(re" *(//|/\*\*|\*\*/|/\*|\*/|\*)", "") - result = result.multiReplace([("\n", "\n "), ("`", "")]).strip() + result = result.multiReplace([("\n", "\n ")]).strip() + result &= "\n```" proc getCommentNodes*(gState: State, node: TSNode, maxSearch=1): seq[TSNode] = ## Get a set of comment nodes in order of priority. Will search up to ``maxSearch``