i have written a number of custom parser-functions that return text which itself contains one of my custom tag-extensions... for example,
function myParserFunction_Render( &$parser, $body = '' ) { return "...<myTag>...</myTag>..."; }
using 1.12.0, i now see <myTag>...</myTag> in the generated page; before (with 1.11.0) i saw the results of processing <myTag> in a separate extension.
i realize the parser has undergone some major changes in 1.12.0.... in the past, it seemed, i was able to "pass" information from parser-functions to tag-extensions through this technique. the latter appeared to handled "after" the parser-functions, and were a place where i could lay down things like <img> and <a> tags....
some more information from some experimentation on my end....
i tried calling $parser->recursiveTagParse($body) inside of myParserFunction_Render, and it *does* work -- but only for some specific cases. my understanding is that recursiveTagParse() is really intended for use inside of *tag* extensions, not parserFunction extensions.
in general, the text passed to my parser function from the perspective of the author can contain: wikitext, calls to parser functions, and use of extension tags.
as i mentioned in the original email, things seemed to just "work" in 1.11 and now they do *NOT* work in 1.12.
any insight into the recent parser change in 1.12 would be helpful here... thanks in advance
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Frankel, Bob Sent: Sunday, April 06, 2008 7:31 PM To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] parser function problem in 1.12.0
i have written a number of custom parser-functions that return text which itself contains one of my custom tag-extensions... for example,
function myParserFunction_Render( &$parser, $body = '' ) { return "...<myTag>...</myTag>..."; }
using 1.12.0, i now see <myTag>...</myTag> in the generated page; before (with 1.11.0) i saw the results of processing <myTag> in a separate extension.
i realize the parser has undergone some major changes in 1.12.0.... in the past, it seemed, i was able to "pass" information from parser-functions to tag-extensions through this technique. the latter appeared to handled "after" the parser-functions, and were a place where i could lay down things like <img> and <a> tags....
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Sounds like what I found a few posts back. To get mine working properly, I had to go back to:
$content = $parser->parse($value,$wgTitle,ParserOptions::newFromUser($wgUser),false,false)->getText();
... in my function. May work for a quick fix!
Kind regards,
Alex
On Wed, Apr 9, 2008 at 12:14 AM, Frankel, Bob bios-bob@ti.com wrote:
some more information from some experimentation on my end....
i tried calling $parser->recursiveTagParse($body) inside of myParserFunction_Render, and it *does* work -- but only for some specific cases. my understanding is that recursiveTagParse() is really intended for use inside of *tag* extensions, not parserFunction extensions.
in general, the text passed to my parser function from the perspective of the author can contain: wikitext, calls to parser functions, and use of extension tags.
as i mentioned in the original email, things seemed to just "work" in 1.11 and now they do *NOT* work in 1.12.
any insight into the recent parser change in 1.12 would be helpful here... thanks in advance
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Frankel, Bob Sent: Sunday, April 06, 2008 7:31 PM To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] parser function problem in 1.12.0
i have written a number of custom parser-functions that return text which itself contains one of my custom tag-extensions... for example,
function myParserFunction_Render( &$parser, $body = '' ) { return "...<myTag>...</myTag>..."; }
using 1.12.0, i now see <myTag>...</myTag> in the generated page; before (with 1.11.0) i saw the results of processing <myTag> in a separate extension.
i realize the parser has undergone some major changes in 1.12.0.... in the past, it seemed, i was able to "pass" information from parser-functions to tag-extensions through this technique. the latter appeared to handled "after" the parser-functions, and were a place where i could lay down things like <img> and <a> tags....
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
hmmm.... the docs for $parser->parse seem to imply that this function should *not* be called recursively; that's what recursiveTagParse is presumably for. still, i can see this working in many cases. what i would be curious about, however, is what happens if this inner-call to parse encounters another parserFunction that in turn calls parse??
-----Original Message----- From: Alex Powell [mailto:alexp@exscien.com] Sent: Wednesday, April 09, 2008 1:43 AM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] parser function problem in 1.12.0
Sounds like what I found a few posts back. To get mine working properly, I had to go back to:
$content = $parser->parse($value,$wgTitle,ParserOptions::newFromUser($wgUser),false ,false)->getText();
... in my function. May work for a quick fix!
Kind regards,
Alex
On Wed, Apr 9, 2008 at 12:14 AM, Frankel, Bob bios-bob@ti.com wrote:
some more information from some experimentation on my end....
i tried calling $parser->recursiveTagParse($body) inside of myParserFunction_Render, and it *does* work -- but only for some specific cases. my understanding is that recursiveTagParse() is really intended for use inside of *tag* extensions, not parserFunction extensions.
in general, the text passed to my parser function from the perspective of the author can contain: wikitext, calls to parser functions, and use of extension tags.
as i mentioned in the original email, things seemed to just "work" in 1.11 and now they do *NOT* work in 1.12.
any insight into the recent parser change in 1.12 would be helpful here... thanks in advance
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Frankel, Bob Sent: Sunday, April 06, 2008 7:31 PM To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] parser function problem in 1.12.0
i have written a number of custom parser-functions that return text which itself contains one of my custom tag-extensions... for example,
function myParserFunction_Render( &$parser, $body = '' ) { return "...<myTag>...</myTag>..."; }
using 1.12.0, i now see <myTag>...</myTag> in the generated page; before (with 1.11.0) i saw the results of processing <myTag> in a separate extension.
i realize the parser has undergone some major changes in 1.12.0.... in the past, it seemed, i was able to "pass" information from parser-functions to tag-extensions through this technique. the
latter
appeared to handled "after" the parser-functions, and were a place where i could lay down things like <img> and <a> tags....
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-- Alex Powell
Exscien Training Ltd Tel: +44 (0) 1865 920024 Direct: +44 (0) 1865 920032 Mob: +44 (0) 7717 765210
skype: alexp700 mailto:alexp@exscien.com http://www.exscien.com
Registered in England and Wales 05927635, Unit 10 Wheatley Business Centre, Old London Road, Wheatley, OX33 1XW, England
Dunno about recursive calls to yourself, but to others it seems to work as intended for me. I took the fifth "false" parameter to leave the parser in a re-enterable state (at least on the older parser ;) ). If you set it to "True", you get a whole new parser, which does break if its used recursively.
On Wed, Apr 9, 2008 at 4:27 PM, Frankel, Bob bios-bob@ti.com wrote:
hmmm.... the docs for $parser->parse seem to imply that this function should *not* be called recursively; that's what recursiveTagParse is presumably for. still, i can see this working in many cases. what i would be curious about, however, is what happens if this inner-call to parse encounters another parserFunction that in turn calls parse??
-----Original Message----- From: Alex Powell [mailto:alexp@exscien.com] Sent: Wednesday, April 09, 2008 1:43 AM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] parser function problem in 1.12.0
Sounds like what I found a few posts back. To get mine working properly, I had to go back to:
$content = $parser->parse($value,$wgTitle,ParserOptions::newFromUser($wgUser),false ,false)->getText();
... in my function. May work for a quick fix!
Kind regards,
Alex
On Wed, Apr 9, 2008 at 12:14 AM, Frankel, Bob bios-bob@ti.com wrote:
some more information from some experimentation on my end....
i tried calling $parser->recursiveTagParse($body) inside of myParserFunction_Render, and it *does* work -- but only for some specific cases. my understanding is that recursiveTagParse() is really intended for use inside of *tag* extensions, not parserFunction extensions.
in general, the text passed to my parser function from the perspective of the author can contain: wikitext, calls to parser functions, and use of extension tags.
as i mentioned in the original email, things seemed to just "work" in 1.11 and now they do *NOT* work in 1.12.
any insight into the recent parser change in 1.12 would be helpful here... thanks in advance
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Frankel, Bob Sent: Sunday, April 06, 2008 7:31 PM To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] parser function problem in 1.12.0
i have written a number of custom parser-functions that return text which itself contains one of my custom tag-extensions... for example,
function myParserFunction_Render( &$parser, $body = '' ) { return "...<myTag>...</myTag>..."; }
using 1.12.0, i now see <myTag>...</myTag> in the generated page; before (with 1.11.0) i saw the results of processing <myTag> in a separate extension.
i realize the parser has undergone some major changes in 1.12.0.... in the past, it seemed, i was able to "pass" information from parser-functions to tag-extensions through this technique. the
latter
appeared to handled "after" the parser-functions, and were a place where i could lay down things like <img> and <a> tags....
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-- Alex Powell
Exscien Training Ltd Tel: +44 (0) 1865 920024 Direct: +44 (0) 1865 920032 Mob: +44 (0) 7717 765210
skype: alexp700 mailto:alexp@exscien.com http://www.exscien.com
Registered in England and Wales 05927635, Unit 10 Wheatley Business Centre, Old London Road, Wheatley, OX33 1XW, England
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org