diff options
author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-09-04 01:33:22 +0000 |
---|---|---|
committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-09-04 01:33:22 +0000 |
commit | a024b2b067ec8a092d783c9baed4b43dd5898d56 (patch) | |
tree | 5193ba9efeea99a82f1cc00f28b189c0f75a7155 /docutils/parsers/rst/directives/body.py | |
parent | 520f573499ee93fd4953686d5a71c30f9ec04ce1 (diff) | |
download | docutils-a024b2b067ec8a092d783c9baed4b43dd5898d56.tar.gz |
Converted system messages to use the new "line" attribute.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@622 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/parsers/rst/directives/body.py')
-rw-r--r-- | docutils/parsers/rst/directives/body.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docutils/parsers/rst/directives/body.py b/docutils/parsers/rst/directives/body.py index 9ba25844e..7d74e7a2b 100644 --- a/docutils/parsers/rst/directives/body.py +++ b/docutils/parsers/rst/directives/body.py @@ -23,11 +23,11 @@ def topic(match, type_name, data, state, state_machine, option_presets): indented, indent, line_offset, blank_finish \ = state_machine.get_first_known_indented(match.end()) blocktext = '\n'.join(state_machine.input_lines[ - initial_offset : line_offset + len(indented)]) + initial_offset : line_offset + len(indented) - 1]) if not state_machine.match_titles: error = state_machine.reporter.error( - 'Topics may not be nested within body elements (line %s).' - % lineno, '', nodes.literal_block(blocktext, blocktext)) + 'Topics may not be nested within body elements.', '', + nodes.literal_block(blocktext, blocktext), line=lineno) return [error], blank_finish if not indented: return [], blank_finish @@ -37,15 +37,15 @@ def topic(match, type_name, data, state, state_machine, option_presets): if indented: if indented[0].strip(): warning = state_machine.reporter.warning( - 'The second line of a topic block must be blank (line %s).' - % (lineno + 1 + line_offset - initial_offset), '') + 'The second line of a topic block must be blank.', + line=lineno + 1 + line_offset - initial_offset) messages.append(warning) text = '\n'.join(indented) else: text = '' topic_node = nodes.topic(text, title, *messages) if text: - state.nested_parse(indented, line_offset, topic_node) + state.nested_parse(indented, line_offset + 1, topic_node) return [topic_node], blank_finish @@ -58,8 +58,8 @@ def line_block(match, type_name, data, state, state_machine, option_presets, indented.pop() if not indented: warning = state_machine.reporter.warning( - 'Text block expected for the "%s" directive after line %s; none ' - 'found.' % (type_name, lineno)) + 'Text block expected for the "%s" directive; none found.' + % type_name, line=lineno) return [warning], blank_finish text = '\n'.join(indented) textnodes, messages = state.inline_text(text, lineno) |