If you try to put the following text into the code bbcode tags:var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[url]','[/url]', '[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);

You can be useful by handling the PR from start to finish. The best way to handle multiple BBCode definitions with the same name may be to replace them with a definition that covers both use case, and do so as a migration.
[...]

The template for 3.2 wouldn't change but the definitions would need to be merged together as such:

In the template above, @* is an XPath expression that means "all/any attributes."

If you do this, the bbcode will be registered as [ref=]. And when you click on the button in the editor box, it will be inserted into the textarea as it. And if you don't manually delete the '=', the result will always be the 'Otherwise'. Which may be annoying for the people used to the previous behaviour.

In phpbb 3.1, writing the tag with '=' has the same annoying behaviour, but defining the same bbcode with different definitions, allows you to put into the editor bar just the one you want. So you can put in it the [ref] ones, and show in the help tooltip the chance to specify an attribute for the optional parameter.

COLOR doesn't accept empty strings so it works as intended but if you use a token that accepts empty strings you can do something like @ref != ''. You can't use the token itself (e.g. {COLOR}) in XPath expressions though.

COLOR doesn't accept empty strings so it works as intended but if you use a token that accepts empty strings you can do something like @ref != ''. You can't use the token itself (e.g. {COLOR}) in XPath expressions though.

Ok, thanks. This is working perfectly for what I'm trying to do.

I think I have a much bigger problem with markup nested inside custom bbcode, which is weird because for what I'm reading in the doc, it should be allowed (of course), and the only issue is related to the same custom bbcode nested multiple times.

Don't wanna abuse your help but a point in the right direction on where to look for about the error (Text formatter? phpbb 3.2?...), would be helpful.

The best way would be to post in the 3.2 support forum with the exact definition of your BBCode, what you type in the post editor to test it, what you get as its output and how it differs from what you expected. Then you can add [quote=JoshyPHP]...[/quote] so I get notified and I'll read it later.