Nested myCode
#1
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]
Reply
#2
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
Reply
#3
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
Reply
#4
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.
Dennis Tsang
Former MyBB Team Member
Web: http://dennistt.net
Reply
#5
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)