Priority: Enhancement
Current State: Proposal Required
Released In: n/a
Target Release: n/a
seems odd for plugin authors not to have a way to say 'render this fragment'
--
SvenDowideit - 07 Apr 2011
If you weren't you, I'd point you to
Foswiki::Func::expandCommonVariables
and its friend
renderText()
, but you are you, so I have to assume you've not explained yourself fully (or perhaps I'm stupid).
--
PaulHarvey - 07 Apr 2011
yup - those 2 don't actually run a full render -
expandCommonVariables
only does a small core subset, and
renderText
only does non-macro markup.
What I noticed was that if you use MACRO-text in the result of your plugin - at a stage late enough that it won't be expanded by the normal core rendering (like the
WikiWordHandler
, you can't use the API to expand it for you.
Mind you, I'm making more of a note for Func2 / Meta2.
--
SvenDowideit - 07 Apr 2011
I'm still confused. IIRC,
expandCommonVariables
is the same as calling
Foswiki::Meta->expandMacros()
, which handles preference variables and plugin macros (via both registerTag and commonTags).
I had always assumed the "common" part of the method name was some bogus legacy thing... so I still don't know what macros aren't being expanded in this case
I've been able to return strings containing other macros as the result of some plugin macro, but I do seem to recall some code comment in
Foswiki.pm
which warned against it... It seems Foswiki won't try to expand a macro more than twice; after the second time, if your tag handler returns itself unchanged, Foswiki seems to "gives up" on rendering that macro rather than get stuck in an endless loop
--
PaulHarvey - 08 Apr 2011
basically, I did that, used it, and nope, it didn't expand the plugin's MACRO - guess i need to test more?
--
SvenDowideit - 12 Apr 2011
My understanding is that it does render plugin tags, but I could be wrong
--
PaulHarvey - 13 Apr 2011
in trying to investigate
Item11682 by writing unit tests, its clear that renderText(expandCommonVariables()) does not get you the output you see in the browser - so there are things missing.
the most obvious, is that variables are not expanded - ATTACHFILESIZELIMIT for example. (see unit test:
RenderTests::test_TOOLTIPS_on_space
for eg)
--
SvenDowideit - 22 Mar 2012
Does the
RecursiveRenderPlugin do anything for this issue?
--
GeorgeClark - 19 Jun 2014