Opened 16 years ago
Last modified 5 years ago
#4750 new enhancement
Included wiki-pages are put in a paragraph
Reported by: | anonymous | Owned by: | |
---|---|---|---|
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 (5)
comment:1 Changed 16 years ago by
comment:2 Changed 15 years ago by
Trac Release: | 0.10 → 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 11 years ago by
Owner: | changed from Noah Kantrowitz to Ryan J Ollos |
---|---|
Status: | new → assigned |
comment:4 Changed 10 years ago by
Hi! Any plans for solving this? Currently I use this hack to remove the paragraphs surrounding the included wiki page:
@@ -152,4 +153,6 @@ class IncludeMacro(WikiMacroBase): if dest_format: out = Mimeview(self.env).render(ctxt, dest_format, out) + out = re.sub(r'^<p>\n', '', out) + out = re.sub(r'\n</p>\n$', '', out)
comment:5 Changed 5 years ago by
Owner: | Ryan J Ollos deleted |
---|---|
Status: | assigned → new |
Cut/Paste types fixed:
wikipage Docs/Foo:
wikipage Docs/FooBar:
Normally I'd expect this setup to generate:
However, I get this;