Use for loop to shrink bbcode

Dry out the long set of similar selectors
Merge pull request #2061 from nschonni/use-loops-for-bbcode

Use for loop to shrink bbcode