We do import (using Feeds_ex) some data into Drupal (we do not control data-source we use to import data) and these data contains HTML in a brackets.

so far I have found these 3 brackets:

 1. [b]bla bla bla[/b]
 2. [i]my text[/i]
 3. [url=http://www.google.com/[/url]

I'm wondering if there is a good approach to deal with these values:

 - Convert them during import?
 - Somehow define in Drupal that these tag are equal to <b>, <i> or <a

At the very end I want to output these data as HTML.

I would be happy to get any suggestion.



That's BBCode.

One option would be to simply install the BBCode module, which contains a BBCode filter. You can then apply that filter to the text format you're using for the body field, and it'll be converted to HTML automatically when rendered.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.