Hello,

I'm running into a problem trying to get the formatting in my macro to
work correctly. In the macro sources I have:
       add_stylesheet(formatter.req, 'spoiler/css/spoiler.css')
       add_javascript(formatter.req, 'spoiler/js/spoiler.js')
       output = tag.div(class_="spoiler")(format_to_oneliner(self.env,
formatter.context,content))

When this gets rendered it ends up as HTML (there's a bit of JQuery
magic in here inserting the <a> and hiding the div):
<p>
This is a </p><a class="reveal" style="display: none;">Reveal Spoiler
&gt;&gt;</a><div class="spoiler" style="display: inline;"><a
href="/trac/wiki/WikiStart" class="wiki">spoiler!</a></div><p>.
</p>

The problem is those <p> tags... I think I only want the first and
last one... not the inline ones since those are causing the layout to
be messed up. (see attached screenshot).  The effect I'm going for is
something like the one found here:
http://css-tricks.com/examples/SpoilerRevealer/

And I think I want then rendered HTML to look something like:
<p>This is a <a class="reveal" style="display: none;">Reveal Spoiler
&gt;&gt;</a><div class="spoiler" style="display: inline;"><a
href="/trac/wiki/WikiStart" class="wiki">spoiler!</a></div>.</p>

Any suggestions? I haven't delved deeply into working with genshi
until recently or tried to do anything this complicated with it in the
past.

Full sources are available from http://trac-hacks.org/wiki/SpoilerMacro.

Thanks in advance,

Ben

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

<<attachment: Screen shot 2012-02-25 at 2.36.05 AM.png>>

Reply via email to