summaryrefslogtreecommitdiff
path: root/docutils/parsers/rst/directives/body.py
diff options
context:
space:
mode:
authordavid_abrahams <david_abrahams@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2004-06-23 02:17:11 +0000
committerdavid_abrahams <david_abrahams@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2004-06-23 02:17:11 +0000
commite9392a97370514aa39851a14552563be3b5c8584 (patch)
tree8d8ce5996b76f3d1c83dde0e668280cf80a44dc9 /docutils/parsers/rst/directives/body.py
parent65fa51b97aaad5094386e9d3b51614989d3c8734 (diff)
downloaddocutils-e9392a97370514aa39851a14552563be3b5c8584.tar.gz
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
Diffstat (limited to 'docutils/parsers/rst/directives/body.py')
-rw-r--r--docutils/parsers/rst/directives/body.py21
1 files changed, 20 insertions, 1 deletions
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}