I added conditionals that make sure the span tag is only stripped if the bold command was used and if the span has a style attribute and no class attribute.