|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-04-01 19:35 UTC] tpunt@php.net
-Status: Open
+Status: Wont fix
[2017-04-01 19:35 UTC] tpunt@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
Description: ------------ How do I support the following tag type? [product=123] This tag accepts an argument but has NO closing tag! I know this can be supported like this: [product]123[/product] or [product=123][/product] But I'm sure you will agree that it is much more verbose! I have tried combinations of using: BBCODE_TYPE_SINGLE with a "param_handling" and/or "content_handling" callback functions! It seems that BBCODE_TYPE_SINGLE ignores the callbacks as soon as you add the argument and leave out the closing tag, probably because BBCODE_TYPE_SINGLE doesn't usually expect additional parameters! I think the fix should be simple; ie. check if there are additional paramenters/arguments in BBCODE_TYPE_SINGLE and run the callbacks! Test script: --------------- $bbcodes = array( 'product' => array( 'type' => BBCODE_TYPE_SINGLE, 'content_handling' => 'bbcode_product' )); function bbcode_product($content, $argument) { return '[PRODUCT]' . $content . ' : ' . $argument . '[/PRODUCT]'; } $parser = bbcode_create($bbcodes); echo bbcode_parse($parser, '[product=123]'); Expected result: ---------------- [PRODUCT]123 : [/PRODUCT] Actual result: -------------- [product=123]