From ebf9018df85aa3385b19aed6273d80390753fdeb Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sat, 23 May 2020 11:29:59 -0600 Subject: Try markdown code block --- nimterop/tshelp.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nimterop/tshelp.nim b/nimterop/tshelp.nim index fa2a750..ad3e89e 100644 --- a/nimterop/tshelp.nim +++ b/nimterop/tshelp.nim @@ -284,18 +284,17 @@ 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 = "::" for commentNode in commentNodes: result &= "\n " & gState.getNodeVal(commentNode).strip() - result = result.multiReplace( + result = "```\n " & result.multiReplace( { "/**": "", "**/": "", "/*": "", "*/": "", "/*": "", "//": "", "\n": "\n ", "`": "" } # need to replace this last otherwise it supercedes other replacements - ).replace(" *", "").strip() + ).replace(" *", "").strip() & "\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`` -- cgit v1.2.3