Description
Using the ReStructuredText include directive results in an Internal Server Error for that page.
Steps to reproduce
Create a new wiki page, ex: http://www.moinmo.in/TestPage, or use an existing page.
- Use rst and make use of the include directive. It doesn't matter if the included page exists, doesn't exist, is or isn't in rst format. See example below.
Example
#format rst .. include:: anything
Component selection
- general
The registered function for the include directive in MoinMoin/parser/text_rst.py does not return a node list.
Details
This Wiki.
Workaround
Add 'include' to the list of disallowed rst directives in MoinMoin/parser/text_rst.py, line 553.
Make the include function return a empty list at line 598 remove the error and solve the problem:
lines = [_("**Could not find the referenced page: %s**") % (pagename, )]
# Insert the text from the included document and then continue parsing
state_machine.insert_input(lines, 'MoinDirectives')
- return
+ return []
include.has_content = include.content = True
include.option_spec = {}
include.required_arguments = 1
Discussion
The proposed fix looks incomplete, there are other places that also just use "return".
Can you explain why returning an EMPTY list is correct?
Plan
- Priority:
- Assigned to:
- Status:
