diff options
author | Araq <rumpf_a@web.de> | 2013-11-19 14:35:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-11-19 14:35:03 +0100 |
commit | 80377c20f972ecb7f8d296e5cff1de0c6800d70a (patch) | |
tree | 1bd25c5c40d59cd8bde692a4a46a3a31083fe33d /lib/packages/docutils | |
parent | 619356dd0886e764945faadccc62281ff6b85aa5 (diff) | |
download | Nim-80377c20f972ecb7f8d296e5cff1de0c6800d70a.tar.gz |
fixes #678
Diffstat (limited to 'lib/packages/docutils')
-rw-r--r-- | lib/packages/docutils/rst.nim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index 91664cd50..6dd407155 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -868,6 +868,12 @@ proc parseLine(p: var TRstParser, father: PRstNode) = case p.tok[p.idx].kind of tkWhite, tkWord, tkOther, tkPunct: parseInline(p, father) else: break + +proc parseUntilNewline(p: var TRstParser, father: PRstNode) = + while True: + case p.tok[p.idx].kind + of tkWhite, tkWord, tkAdornment, tkOther, tkPunct: parseInline(p, father) + of tkEof, tkIndent: break proc parseSection(p: var TRstParser, result: PRstNode) proc parseField(p: var TRstParser): PRstNode = @@ -1078,7 +1084,7 @@ proc parseParagraph(p: var TRstParser, result: PRstNode) = proc parseHeadline(p: var TRstParser): PRstNode = result = newRstNode(rnHeadline) - parseLine(p, result) + parseUntilNewLine(p, result) assert(p.tok[p.idx].kind == tkIndent) assert(p.tok[p.idx + 1].kind == tkAdornment) var c = p.tok[p.idx + 1].symbol[0] @@ -1172,7 +1178,7 @@ proc parseOverline(p: var TRstParser): PRstNode = inc(p.idx, 2) result = newRstNode(rnOverline) while true: - parseLine(p, result) + parseUntilNewline(p, result) if p.tok[p.idx].kind == tkIndent: inc(p.idx) if p.tok[p.idx - 1].ival > currInd(p): |