Description
RenderAsDocbook action failed with an exception, if the page contains a titlesonly Include macro.
File "/srv/moin/code/1.8/MoinMoin/wikiutil.py", line 2372, in link_tag tag = (formatter.url(1, url, css_class, **kw) + File "/srv/moin/code/1.8/MoinMoin/formatter/text_docbook.py", line 376, in url return self._handleNode("ulink", on, attributes=(('url', url), )) File "/srv/moin/code/1.8/MoinMoin/formatter/text_docbook.py", line 654, in _handleNode node = self.doc.createElement(name) AttributeError: Formatter instance has no attribute 'doc'
-- JiangXin 2008-09-21 04:07:37
Steps to reproduce
- One page include another page with titlesonly parameter, like this:
<<Include(AnotherPage,,,titlesonly)>>
Do a RenderAsDocbook action on the page.
Example
JiangXin/TestPage?action=RenderAsDocbook
Component selection
- formatter [text_docbook]
Details
This wiki.
Workaround
Patch on MoinMoin 1.7.1:
1 --- a/MoinMoin/formatter/text_docbook.py 2008-09-17 23:09:41.000000000 +0800
2 +++ b/MoinMoin/formatter/text_docbook.py 2008-09-17 23:47:59.000000000 +0800
3 @@ -70,6 +70,8 @@
4 self.doctype = doctype
5 self.curdepth = 0
6 self.cur = None
7 + if self.include_kludge:
8 + self.startContent()
9
10 def startDocument(self, pagename):
11 self.doc = dom.createDocument(None, self.doctype, dom.createDocumentType(
Note:
RenderAsDocbook action works, and no exception raised, but:
- But linked titles not appear in rendered docbook text as expected.
Discussion
Plan
- Priority:
- Assigned to:
- Status: