Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Links and <br /> tags with Better BB Code 1.0
Hello.
I have a problem with the Better BBCode extension v.1.0. If I have a line break just after the URL and some text after that, the extenstion takes the "br" part with it.
So, when I type:
"http://www.url.com
some text below the url"
It comes out as:
Other extensions that I have installed are: Discussion filters 1.0, Extended Application Form 1.0, New Applicants 1, Quotations 1.5, Role History 1.0, Saved Searches 2.0, Text Mode Switch 1.0, Transmogrifier 1.1, Who's Online 1.1.
Note that the "Format comments as BBcode" is chosen.
Thanks in advance.
I have a problem with the Better BBCode extension v.1.0. If I have a line break just after the URL and some text after that, the extenstion takes the "br" part with it.
So, when I type:
"http://www.url.com
some text below the url"
It comes out as:
Other extensions that I have installed are: Discussion filters 1.0, Extended Application Form 1.0, New Applicants 1, Quotations 1.5, Role History 1.0, Saved Searches 2.0, Text Mode Switch 1.0, Transmogrifier 1.1, Who's Online 1.1.
Note that the "Format comments as BBcode" is chosen.
Thanks in advance.
0
This discussion has been closed.
Comments
sure you can. or make a FAQ sticky post.
$pattern = array( "!(^|\s|\()((((http(s?)|ftp)://)|www)[-a-z0-9.]+\.[a-z]{2,4}[^\s()]*)!i", "!".$oe."url(".$ce."|\s.*".$ce.")(.*)".$oe."/url".$ce."!iU"); $replace = array( "\\1".$o."url".$c."\\2".$o."/url".$c, $o."url=\\2\\1\\2".$o."/url".$c); $this->_preparsed = preg_replace($pattern, $replace, $this->_preparsed);
in the preparse function of BBCodeParser.php. To stop the auto replacement, change it to this:
$pattern = array("!".$oe."url(".$ce."|\s.*".$ce.")(.*)".$oe."/url".$ce."!iU"); $replace = array($o."url=\\2\\1\\2".$o."/url".$c); $this->_preparsed = preg_replace($pattern, $replace, $this->_preparsed);
Any one know of the
<br/>
culprit in the code?edit/update: Some more issues...The parser is tripping up (BBCodeParser.php) in these scenarios as well:
- link will not be parsed if it is not the FIRST piece of content in the comment body (very odd issue, quite buggy...seems to be very touchy with manually entered spaces before/after it????)
- only one line will be parsed, entering a link on more than one line will only result in the first line being successfully parsed
- "shorthand" URLs (wwithout the "http://") simply won't work at all. They'll be parsed if they meet the above prerequisites, but the parser hooks the shorthand URL on the end of the forum URL resulting in a link to http://www.domain.com/forum/www.ShortHandURL.com
Can anyone head me in the right direction with the parser? Do these problems lie in the links portion of the BB parser?
//Links $pattern = array( "!(^|\s|\()((((http(s?)|ftp)://)|www)[-a-z0-9.]+\.[a-z]{2,4}[^\s()]*)!i", "!".$oe."url(".$ce."|\s.*".$ce.")(.*)".$oe."/url".$ce."!iU"); $replace = array( "\\1".$o."url".$c."\\2".$o."/url".$c, $o."url=\\2\\1\\2".$o."/url".$c); $this->_preparsed = preg_replace($pattern, $replace, $this->_preparsed);