From e9392a97370514aa39851a14552563be3b5c8584 Mon Sep 17 00:00:00 2001 From: david_abrahams Date: Wed, 23 Jun 2004 02:17:11 +0000 Subject: Fix the line numbering of nodes produced by line_block directives. This is a total shot-in-the-dark, since it's unclear why lineno is 97 and content_offset is the right line number. Without some description of the protocol I can't really know, but it seems to be working... for now. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@2361 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/parsers/rst/directives/body.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'docutils') diff --git a/docutils/parsers/rst/directives/body.py b/docutils/parsers/rst/directives/body.py index c63ac8aef..bfe2e695f 100644 --- a/docutils/parsers/rst/directives/body.py +++ b/docutils/parsers/rst/directives/body.py @@ -15,7 +15,25 @@ import sys from docutils import nodes from docutils.parsers.rst import directives - +# Directive Handler Functions +# +# What they do is blah blah +# +# They are called by blah blah after being looked up blah blah +# +# Parameter Required Type Role +# ============== ============= ============================= +# name str ??? +# arguments ??? ??? +# options ??? ??? +# content ??? ??? +# lineno ??? ??? +# content_offset ??? ??? +# block_text ??? ??? +# state ??? ??? +# state_machine ??? ??? +# node_class ??? ??? + def topic(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine, node_class=nodes.topic): @@ -74,6 +92,7 @@ def line_block(name, arguments, options, content, lineno, text = '\n'.join(content) text_nodes, messages = state.inline_text(text, lineno) node = node_class(text, '', *text_nodes, **options) + node.line = content_offset return [node] + messages line_block.options = {'class': directives.class_option} -- cgit v1.2.1