PDA

View Full Version : GAL fails if the term is wrapped in BBCode


minstrel
05-18-2009, 06:17 PM
For defined GAL terms, wrapping the term in any BBcode causes the autolink to fail.

This included bolding, italics, etc., as you can see here:

GAL

GAL

GAL

GAL

GAL

GAL

GAL

Any way to work around this?

Morgan
05-19-2009, 05:38 PM
GALs between HTML tags do not auto-link. Let's use an A HREF tag as an example. GAL (http://www.thevbgeek.com/) does not auto-link whereas GAL does. Why do that? Because you wouldn't want <a href="http://www.thevbgeek.com/">whatever</a> auto-linked as it might screw up the link. Same goes for other HTML markup. You don't want text inside the actual tag such as attributes to auto-link, and you don't want text between tags to auto-link, because doing so might break the HTML. There is no nice way to handle every single possible text combination that a user could enter in a post. IMO the best regular expression that I made is as follows, but if you want to try a different one, you can do that via the ACP GAL Regular Expressions option:

#(\b($1)\b(?=[^>]*<)(?![^<]*</))#im

minstrel
06-17-2009, 09:24 PM
Forn some reason, I didn't receive the email notification of your reply to this thread so I'm just getting back to it now.

What I would like is for GAL to ignore the following codes:

Bold [b
Italics [I
Undelrine [u
Color [COLOR
Font [FONT
Size [SIZE
Can you tell me how to change the GAL regex to allow this?

Morgan
06-22-2009, 04:34 PM
There is not a nice way to account for certain tags while discounting other tags. Untested but you can try the following though you may need to try different renditions as well:

#(\b((?<=\s|<b>|<i>|<u>|<font color="*">|<font face="*">|<font size="*">)($1))\b)#im

Looking at the "assertions" section on this (http://www.php.net/manual/en/regexp.reference.php) page may help you create the regular expression you want.