aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Yakimowich-Payne <jyapayne@gmail.com>2020-05-23 11:29:59 -0600
committergenotrance <dev@genotrance.com>2020-05-25 22:31:09 -0500
commitebf9018df85aa3385b19aed6273d80390753fdeb (patch)
tree9b2ec3c9fd1294ba81659257e8691bca9e03e297
parentf1b5f5b8905a015c4e220c7689b7a05ac9375eee (diff)
downloadnimterop-ebf9018df85aa3385b19aed6273d80390753fdeb.tar.gz
nimterop-ebf9018df85aa3385b19aed6273d80390753fdeb.zip
Try markdown code block
-rw-r--r--nimterop/tshelp.nim5
1 files 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``