Hello Devs,
As I understand, If a wiki macro supports inline mode and is executed as an
inline macro, it must be true that the output generated by the macro does
not contain block elements (otherwise the result will not be inline). From
the wiki macro bridge code we have the following check:
<code>
List<Block> result = xdom.getChildren();
// If in inline mode remove any top level paragraph.
if (context.isInline()) {
this.parserUtils.removeTopLevelParagraph(result);
}
</code>
This only removes the top-level paragraph block. It's possible that inside
the content there are more block level elements, I think this is where we
need the inline parser.
Another problem i discovered is if i have a wiki macro with macro code:
<code>
{{velocity}}
.....
{{/velocity}}
</code>
This makes the {{velocity}} macro behave in a non-inline fashion regardless
of the wiki macro's intentions. Further more, the paragraph block generated
by the {{velocity}} macro is not stripped by the check I mentioned above.
This is because the paragraph block resides inside a MacroMarkerBlock (so it
is not a top-level paragraph).
A workaround I found for this problem is to have something like:
<code>
{{html}}{{/html}}{{velocity}}
.....
{{/velocity}}
</code>
This is only a hack to force the {{velocity}} macro ro behave in an inline
fashion.
Now I'm wondering if we should wait for the inline parser to be available to
fix this or do some custom hacking to get rid of the block elements
generated while executing in inline mode. wdyt?
Thanks.
- Asiri