> Alternatively, you could search for newlines in `content`:
>        def expand_macro(self, formatter, name, content, args):
>                if '\n' in content:
>                        # multiple lines
>                else:
>                        # single line

Thanks! This worked great. I now use format_to_html for the multiline
case and format_to_oneliner in the single line case at the code
behaves exactly the way I want.

> Related: You could implement `is_inline`.[2] In Trac 0.13 this allows you to
> use inline macros in titles and other inline formatted content.
>
> I.e. just add something like this:
>        def is_inline(self, content):
>                return not '\n' in content
>
> And you can do something like this:
>        == This title contains a [[Spoiler(spoiler)]]

I'll take a look into this when I start updating my installations to
0.13 later this year.

Thanks again,
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.

Reply via email to