summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2021-04-29 18:31:15 +0300
committerGitHub <noreply@github.com>2021-04-29 17:31:15 +0200
commit16405083485967a395b8d677833bc26040881b21 (patch)
treea60fa53745e1ac48c2dc189347c1ad470a0d701b /compiler
parente61381a293ab4986427c5ce8968c6c031c83f34f (diff)
downloadNim-16405083485967a395b8d677833bc26040881b21.tar.gz
more strict RST inline markup parsing (#17827)
* more strict RST inline markup parsing
* add test for unexpected bonus
* introduce `roPreferMarkdown`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 977fcf8ef..78fb88f9b 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -178,7 +178,8 @@ proc newDocumentor*(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef,
   result.outDir = conf.outDir.string
   initRstGenerator(result[], (if conf.cmd != cmdRst2tex: outHtml else: outLatex),
                    conf.configVars, filename.string,
-                   {roSupportRawDirective, roSupportMarkdown, roNimFile},
+                   {roSupportRawDirective, roSupportMarkdown,
+                    roPreferMarkdown, roNimFile},
                    docgenFindFile, compilerMsgHandler)
 
   if conf.configVars.hasKey("doc.googleAnalytics"):
@@ -1380,7 +1381,9 @@ proc commandRstAux(cache: IdentCache, conf: ConfigRef;
   d.isPureRst = true
   var rst = parseRst(readFile(filen.string), filen.string,
                      line=LineRstInit, column=ColRstInit,
-                     d.hasToc, {roSupportRawDirective, roSupportMarkdown}, conf)
+                     d.hasToc,
+                     {roSupportRawDirective, roSupportMarkdown, roPreferMarkdown},
+                     conf)
   var modDesc = newStringOfCap(30_000)
   renderRstToOut(d[], rst, modDesc)
   d.modDesc = rope(modDesc)