For the Op your BBcode wrapper would likely be a candidate.
This example above can help the Op with a starting point