In most cases, highlighting some text before using a feature will insert the relevant code or tag before and after the selected text.
For example, if Brown in
Quick Brown Fox is highlighted, bold will insert asterisks before and after Brown:
Quick **Brown** Fox
But if a paragraph is highlighted before pressing the Spoiler button, both tags are put in front of the highlighted text, which is inconsistent and unhelpful.
The Spoiler icon should work exactly the same as other features, with the second tag being placed after the highlighted text.