diff options
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/docutils/rst.nim | 13 | ||||
-rw-r--r-- | packages/docutils/rstgen.nim | 7 |
2 files changed, 14 insertions, 6 deletions
diff --git a/packages/docutils/rst.nim b/packages/docutils/rst.nim index f594a39f5..b22bdf6ce 100755 --- a/packages/docutils/rst.nim +++ b/packages/docutils/rst.nim @@ -313,6 +313,10 @@ proc rstMessage(p: TRstParser, msgKind: TMsgKind, arg: string) = p.s.msgHandler(p.filename, p.line + p.tok[p.idx].line, p.col + p.tok[p.idx].col, msgKind, arg) +proc rstMessage(p: TRstParser, msgKind: TMsgKind, arg: string, line, col: int) = + p.s.msgHandler(p.filename, p.line + line, + p.col + col, msgKind, arg) + proc rstMessage(p: TRstParser, msgKind: TMsgKind) = p.s.msgHandler(p.filename, p.line + p.tok[p.idx].line, p.col + p.tok[p.idx].col, msgKind, @@ -684,6 +688,9 @@ when false: proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string, interpretBackslash: bool) = + let + line = p.tok[p.idx].line + col = p.tok[p.idx].col while true: case p.tok[p.idx].kind of tkPunct: @@ -707,7 +714,7 @@ proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string, of tkWhite: add(father, newRstNode(rnLeaf, " ")) inc(p.idx) - else: rstMessage(p, meExpected, postfix) + else: rstMessage(p, meExpected, postfix, line, col) proc parseMarkdownCodeblock(p: var TRstParser): PRstNode = var args = newRstNode(rnDirArg) @@ -1012,10 +1019,10 @@ proc whichSection(p: TRstParser): TRstNodeKind = result = rnOptionList else: result = rnParagraph - of tkWord, tkOther, tkWhite: + of tkWord, tkOther, tkWhite: if match(p, tokenAfterNewLine(p), "ai"): result = rnHeadline - elif isDefList(p): result = rnDefList elif match(p, p.idx, "e) ") or match(p, p.idx, "e. "): result = rnEnumList + elif isDefList(p): result = rnDefList else: result = rnParagraph else: result = rnLeaf diff --git a/packages/docutils/rstgen.nim b/packages/docutils/rstgen.nim index 492322f6f..53bd8188e 100644 --- a/packages/docutils/rstgen.nim +++ b/packages/docutils/rstgen.nim @@ -390,7 +390,8 @@ proc renderField(d: PDoc, n: PRstNode, result: var string) = if d.target == outLatex: var fieldname = addNodes(n.sons[0]) var fieldval = esc(d.target, strip(addNodes(n.sons[1]))) - if cmpIgnoreStyle(fieldname, "author") == 0: + if cmpIgnoreStyle(fieldname, "author") == 0 or + cmpIgnoreStyle(fieldname, "authors") == 0: if d.meta[metaAuthor].len == 0: d.meta[metaAuthor] = fieldval b = true @@ -474,8 +475,8 @@ proc renderRstToOut(d: PDoc, n: PRstNode, result: var string) = of rnTableRow: if len(n) >= 1: if d.target == outLatex: - var tmp = "" - renderRstToOut(d, n.sons[0], tmp) + #var tmp = "" + renderRstToOut(d, n.sons[0], result) for i in countup(1, len(n) - 1): result.add(" & ") renderRstToOut(d, n.sons[i], result) |