rst: single backticks now render correctly in both rst2html and github (#17028)

* rst: `` => `
* support default-role in rst2html
* update docstyle regarding single vs double backticks
This commit is contained in:
Timothee Cour 2021-02-13 00:30:23 -08:00 • committed by GitHub
commit 190fe36eba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 60 deletions

View file

@ -1978,6 +1978,10 @@ proc dirAdmonition(p: var RstParser, d: string): PRstNode =
result.kind = rnAdmonition
result.text = d
proc dirDefaultRole(p: var RstParser): PRstNode =
result = parseDirective(p, {hasArg}, nil)
result.kind = rnDefaultRole
proc dirRawAux(p: var RstParser, result: var PRstNode, kind: RstNodeKind,
contentParser: SectionParser) =
var filename = getFieldValue(result, "file")
@ -2037,6 +2041,7 @@ proc selectDir(p: var RstParser, d: string): PRstNode =
of "tip": result = dirAdmonition(p, d)
of "title": result = dirTitle(p)
of "warning": result = dirAdmonition(p, d)
of "default-role": result = dirDefaultRole(p)
else:
rstMessage(p, meInvalidDirective, d)