mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 02:03:59 +00:00
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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user