Hi
we have a drupal 5.12 for frontpage an dinvisionboard for forum
we often create a thread on furm for news announcement and then copy its bbcode to drupal
However, I find that Drupal's bbcode module do not support
[code]
[url="http://123.com"] 456 [/url]
[/code]

We then have to remove "" to make it work.
This is annoying because often we have a more than 10 links on page and we have to do a lot of manualy work

any idea how to fix this please?

thanks

Comments

naudefj’s picture

Status: Active » Postponed

Can you please prepare a patch for this?

iKillBill2’s picture

yes, that would be good! please!

mgorla’s picture

This Issue is presnt in 6.x-1.2 too, can anyone find a patch for this?

edit: I created my own mymodule_filter that does an str_replace in the "prepare" operation to solve the problem

    case 'prepare':
      $text = str_replace("[url=\"", "[url=", $text);
      $text = str_replace("\"]", "]", $text);     
      return $text;
marcushenningsen’s picture

Version: 5.x-2.1 » 6.x-1.2
Category: support » feature
Status: Postponed » Needs review

My solution to this was to add the following lines to bbcode-filter.inc to the "links" section (lines 161-165):

'#\[url=\"www\.([\w:;&,%+~!=@\/\.\-\#\?]+?)\"\](.*?)\[/url(?::\w+)?\]#si' => '<a href="http://www.\\1" class="bb-url tis3">\\2</a>',
'#\[url=\"([\w:;&,%+~!=@\/\.\-\#\?]+?)\"\](.*?)\[/url(?::\w+)?\]#si'      => '<a href="\\1" class="bb-url tis2">\\2</a>',

This seems to make the doublequoted url's render. I've no idea whether this solution has negative side effects. I'll be happy to provide a patch, if the module maintainer is interested.

Marcus

dob_’s picture

Category: feature » bug
Priority: Normal » Major
johnzzon’s picture

Version: 6.x-1.2 » 7.x-1.0
Issue summary: View changes
StatusFileSize
new1004 bytes

I solved this by just adding "?\'? in two places in the last links regex, simply allowing there to be 0 or 1 matches of either single quote or double quote around the URL. Figured I'd drop this patch here for anyone coming here looking for a fix as well.

The patch is for 7.x-1.0, but the change should be possible towards 6.x as well.

naudefj’s picture

Status: Needs review » Fixed

Patch applied. Thank you so much!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.