Modify

Opened 5 years ago

Last modified 8 months ago

#4750 assigned enhancement

Included wiki-pages are put in a paragraph

Reported by: anonymous Owned by: rjollos
Priority: normal Component: IncludeMacro
Severity: minor Keywords:
Cc: Trac Release: 0.11

Description

Hi,

I recently reported this with WikiIncludePlugin ([ticket#4749]), and after testing IncludeMacro I hit the same problem.

Currently all included wikipages are embedded in paragraphs. Is there any way to prevent this behaviour?

Logically, if I wanted a paragraph I would put empty lines above and below the macro when I use it.

Example:

I've created the wikipage "Nav/Foo" with links to documentation of the Foo - project. All pages in the documentation start off with a level 1 header, then a wikiinclude macro including the navigation block.

This way, when I create a new page I only need to put the link in "Nav/Foo", and it is available on all related pages.

wikipage Nav/Foo:

[wiki:Docs/Foo Foo] | [wiki:Docs/Foo-subsystem FooBar]

wikipage Docs/Foo:

= Foo =
[[Include(Docs/Foo)]]

Something

wikipage Docs/FooBar:

= Foo =
[[Include(Docs/Foo)]]

Something else.

Normally I'd expect this setup to generate:

= Foo =
[wiki:Docs/Foo Foo] | [wiki:Docs/FooBar FooBar]
..

However, I get this;

= Foo =
<p>
[wiki:Docs/Foo Foo] | [wiki:Docs/FooBar FooBar]
</p>
..

Attachments (0)

Change History (3)

comment:1 in reply to: ↑ description Changed 5 years ago by anonymous

Cut/Paste types fixed:

wikipage Docs/Foo:

= Foo =
[[Include(Nav/Foo)]]

Something

wikipage Docs/FooBar:

= Foo =
[[Include(Nav/Foo)]]

Something else.

Normally I'd expect this setup to generate:

= Foo =
<a class="wiki" href="/trac/wiki/Docs/Foo ... and so on.
..

However, I get this;

= Foo =
<p>
<p>
<a class="wiki" href="/trac/wiki/Docs/Foo ... and so on.
</p>
..

comment:2 Changed 4 years ago by anonymous

  • Trac Release changed from 0.10 to 0.11

If I am understanding what is wanted, which was analogous to what I wanted, then basically this will do the trick:
At the bottom of class WikiIncludeMacro(Component):'s def render_macro(self, req, name, txt): add .strip('</p>') to the bottom of the return wiki_to_html(text, self.env, req), i.e.

		return wiki_to_html(text, self.env, req).strip('</p>')

HTH

comment:3 Changed 8 months ago by rjollos

  • Owner changed from coderanger to rjollos
  • Status changed from new to assigned

Add Comment

Modify Ticket

Action
as assigned .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.