more strict RST inline markup parsing (#17827)
* more strict RST inline markup parsing * add test for unexpected bonus * introduce `roPreferMarkdown`
This commit is contained in:
parent
e61381a293
commit
1640508348
3 changed files with 207 additions and 13 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue