Make rstgen work with gcsafe (#20534)
* Make rstgen work with gcsafe Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> * add tests and fixes * if nimHasWarningAsError Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com>
This commit is contained in:
parent
1f2075042b
commit
e290b028ab
6 changed files with 18 additions and 9 deletions
|
|
@ -1684,3 +1684,8 @@ suite "local file inclusion":
|
|||
discard "```nim file = ./readme.md\n```".toHtml(error=error)
|
||||
check(error[] == "input(1, 23) Error: disabled directive: 'file'")
|
||||
|
||||
proc documentToHtml*(doc: string, isMarkdown: bool = false): string {.gcsafe.} =
|
||||
var options = {roSupportMarkdown}
|
||||
if isMarkdown:
|
||||
options.incl roPreferMarkdown
|
||||
result = rstToHtml(doc, options, defaultConfig())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue