You are here: Foswiki>Tasks Web>Item10608 (19 Jun 2014, GeorgeClark)Edit Attach

Item10608: Func is missing a 'renderAllRegisteredTags' func

pencil
Priority: Enhancement
Current State: Proposal Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiFunc
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: GeorgeClark
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 smile

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
 

ItemTemplate edit

Summary Func is missing a 'renderAllRegisteredTags' func
ReportedBy SvenDowideit
Codebase 1.1.4, trunk
SVN Range
AppliesTo Engine
Component FoswikiFunc
Priority Enhancement
CurrentState Proposal Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r10 - 19 Jun 2014, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy