#6591 closed defect (fixed)
Formatter is not correctly initialized on mimeview.rst
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | rendering | Version: | devel |
Severity: | blocker | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
On trac/mimeview/rst.py, Formatter
is not correctly initialised.
The code bellow will fail to render correctly on trac .11 until fixed:
class Foo(object): pass
Line 147 should be:
processor = WikiProcessor(Formatter(self.env, context), language)
Not:
processor = WikiProcessor(Formatter(context), language)
Attachments (0)
Change History (5)
comment:1 by , 17 years ago
follow-up: 3 comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I spotted PythonDoc.py
in that Traceback. Is that the macro cmlenz has for Genshi and Babel docs? Is that macro 0.11 compatible?
The Trac patch was good anyway, and looks like a miss from context-refactoring. Committed as [6377].
Closing the ticket as Trac rst code rendering is now working again, and as I'm quite certain the macro problem is an issue with the macro and not Trac.
follow-up: 4 comment:3 by , 17 years ago
Replying to osimons:
I spotted
PythonDoc.py
in that Traceback. Is that the macro cmlenz has for Genshi and Babel docs? Is that macro 0.11 compatible?
It is, and no, not .11 compatible, I had to change it a bit
The Trac patch was good anyway, and looks like a miss from context-refactoring. Committed as [6377].
Closing the ticket as Trac rst code rendering is now working again, and as I'm quite certain the macro problem is an issue with the macro and not Trac.
The macro still throws some issues, yet, another question, has it been thought, to integrate pygments rst-directive since it would handle all sorts of code blocks and still render as plain-text if lexer not found?
follow-up: 5 comment:4 by , 17 years ago
Replying to Pedro Algarvio, aka, s0undt3ch <ufs@ufsoft.org>:
… has it been thought, to integrate pygments rst-directive since it would handle all sorts of code blocks and still render as plain-text if lexer not found?
Well, pygments is only the default/recommended source code renderer for 0.11 - enscript and clearsilver are still supported and in wide-spread use.
I do see the rationale of having a plain-text pre-formatted fallback through - in some cases. For source code that could make sense, for macros at least they should throw an error like they usually do when something is wrong. However, currently we do not differentiate between them, and have no idea what a missing processor would intend to be doing.
That suggested directive would make it possible to differentiate, but then we would have a directive that worked in rst without an equivalent in standard Trac. That is not ideal either.
While the above fixes the rst renderer, when relying on it on a seperate macro I get:
a print of the context
__dict__
keys:While when rendering a
{{{#!rst}}}
block on a wiki page: