Tapping brackets [ ] button on iOS puts entire row in brackets, if highlighted

I’m trying to highlight a bit of text and then hit the brackets button to wrap that highlighted text after the fact. However, it actually wraps the entire line, which isn’t expected behavior.