I'm looking to incorporate BBcode into my Drupal install, which is used for community blogging at a college. Part of the attraction (a big part) is the hyperlinking of URLs (which non-tech folks seem to have problems with). In testing BBcode, however, it seems that it will only hyperlink a URL if its part of a sentence -- if its a standalone URL, on its own line, it doesn't get hyperlinked. Any chance that this capability could be added to the code (or has it been added in the 4.7 version?)

I'm looking at the code, and ready to start experimenting, but I wanted to check first to see if there was an easy solution.

Comments

naudefj’s picture

It's probably already fixed - I cannot replicate the problem with Drupal 4.7 RC1.

NukeHavoc’s picture

ok -- I plan on migrating to 4.7 eventually after testing, but I'm at 4.6.6 now. I'll look at the 4.7 code to see if there's an easy way to backport the solution to my version as a temporary fix.

NukeHavoc’s picture

I tried pasting the URL pattern-matching logic from 4.7 into the 4.6 module, but it didn't work.

Naudefj -- when you tried it on your install, was the hyperlink completely on its own line, with only space above and below, like this:

http://www.cnn.com

On my 4.6 machine, the hyperlink problem only shows up if the link appears on its own line, without text above or below. If it immediately follows a block of text, say like this...
http://www.cnn.com

...then the link works.

naudefj’s picture

Apply this patch to see if it resolves your problem -
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/bbcode/bbcode...

naudefj’s picture

Assigned: Unassigned » naudefj
Status: Active » Fixed

Please reopen if the provided solution doesn't work.

NukeHavoc’s picture

This did the trick -- thanks!

NukeHavoc’s picture

One more problem child -- hyperlinks that appear within parenthesis don't get hyperlinked, e.g.: (http://www.test.com)

naudefj’s picture

NukeHavoc’s picture

thanks. that worked.

Anonymous’s picture

Status: Fixed » Closed (fixed)