I find that on my 3.2.1 test forum, I can do this with CSS and the following BBCode:
BBCode:
[spoiler]{TEXT}[/spoiler]
Replacement:
<span class="spoiler" onmouseover="this.className='spoiler hover'" onmouseout="this.className='spoiler'"><span>{TEXT}</span></span>
Where the classes referred to in the replacement code are defined in a CSS called from stylesheet.css.
This works exactly as I had intended, until...
I also have implemented the iFrame-based YouTube BBCode:
BBCode:
[youtube]{SIMPLETEXT}[/youtube]
Replacement:
<div class="video-wrapper">
<div class="video-container">
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/{SIMPLETEXT}" style="border: none;" allowfullscreen></iframe>
</div>
</div>
When the YouTube BBCode is nested within the Spoiler, the HTML substitute for YouTube no longer takes place. If I post:
[spoiler][youtube]Fwr1Z7uyXz4[/youtube][/spoiler]
the HTML generated is:
<span class="spoiler" onmouseover="this.className='spoiler hover'" onmouseout="this.className='spoiler'"><span>[youtube]Fwr1Z7uyXz4[/youtube]</span></span>
Upon further investigation, I find the if the YouTube BBCode is nested within any other BBCode (even the default ones like underline), phpBB does not do the YouTube replacement. My CCS-based spoiler BBCode works with everything else that I have tested nested inside of it. If a blank or mangled iFrame or some sort of error message had shown up, I would have been tempted to blame the YouTube replacement code. However, it appears that phpBB is not even attempting the BBCode replacement for the YouTube tag when it is nested.
Should this work, or am I just lacking some key understanding of the BBCode engine?