MyBB Community Forums

Full Version: Nested myCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have declared a myCode:

regexp
\[hide\](.*?)\[/hide\]
replace with
<span style="text-decoration: underline;" onclick="this.style.textDecoration='none'; this.innerHTML='$1'">Click to show the hidden text</span>

Which should give me a simple tag for hiding "spoilers". Works fine, but nested tags like
[hide]Hidden once.
[hide]Hidden twice.[/hide]
Something after that.[/hide]
get parsed as
<span style="text-decoration: underline;" onclick="this.style.textDecoration='none'; this.innerHTML='Hidden once.<br />
[hide]Hidden twice.'">Click to show the hidden text</span><br />
Something after that.[/hide]
That's from a plugin ? My knowledge of regexp is poor, but i thought you needed to add #si at the end of it =/ =P
LeX- Wrote:That's from a plugin ?
Nope, I just created my very own MyCode.

Edit: errr... someone moved this into Plugins, but it should stay in Bug reports... Toungue
That's because of the way the regular expression works. If you try something like
[url=http://www.dennistt.net]something[url=http://google.com]google[/url]that was google[/url]
it'll have the same result.
This isn't a MyBB Bug. We don't include the posibility for delimiters because too many people don't know how those work. And those that do, can easily write a plugin to take advantage of the more advanced functionality of PHP and MyBB.

In the end, Custom MyCode was not meant to be advanced at all