Donald Hunter <donald.hunter@xxxxxxxxx> writes: >> # Parse message with RSTParser >> - for i, line in enumerate(msg.split('\n')): >> - result.append(line, document.current_source, i) >> + lineoffset = 0; >> + for line in msg.split('\n'): >> + match = self.re_lineno.match(line) >> + if match: >> + lineoffset = int(match.group(1)) >> + continue >> + >> + result.append(line, document.current_source, lineoffset) > > I expect this would need to be source=document.current_source, offset=lineoffset Ignore that. I see it's not kwargs. It's just the issue below. >> rst_parser = RSTParser() >> rst_parser.parse('\n'.join(result), document) > > But anyway this discards any line information by just concatenating the > lines together again. Looks to me like there's no Parser() API that works with ViewList() so it would be necessary to directly use the docutils RSTStateMachine() for this approach to work.