Fix comments not being valid rst
This commit is contained in:
parent
e867497e0b
commit
eba4d3bc6b
1 changed files with 3 additions and 3 deletions
|
|
@ -614,7 +614,7 @@ proc getNameKind*(name: string): tuple[name: string, kind: Kind, recursive: bool
|
|||
|
||||
proc getCommentVal*(gState: State, commentNode: Option[TSNode]): string =
|
||||
if commentNode.isSome():
|
||||
result = gState.getNodeVal(commentNode.get()).replace(re" *(/\*\*|\*\*/|\*/|\*)", "").strip()
|
||||
result = "::\n " & gState.getNodeVal(commentNode.get()).replace(re" *(/\*\*|\*\*/|\*/|\*)", "").replace("\n", "\n ").strip()
|
||||
|
||||
template findComment(procName: untyped): untyped =
|
||||
result = none(TSNode)
|
||||
|
|
@ -626,10 +626,10 @@ template findComment(procName: untyped): untyped =
|
|||
sibling = sibling.`procName`()
|
||||
i += 1
|
||||
|
||||
proc getPrevCommentNode*(node: TSNode, maxSearch=4): Option[TSNode] =
|
||||
proc getPrevCommentNode*(node: TSNode, maxSearch=1): Option[TSNode] =
|
||||
findComment(tsNodePrevNamedSibling)
|
||||
|
||||
proc getNextCommentNode*(node: TSNode, maxSearch=4): Option[TSNode] =
|
||||
proc getNextCommentNode*(node: TSNode, maxSearch=1): Option[TSNode] =
|
||||
findComment(tsNodeNextNamedSibling)
|
||||
|
||||
proc getTSNodeNamedChildNames*(node: TSNode): seq[string] =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue