Move \n -> <br> replacement after widgets

Since the widget code looks at selection{Start,End} to determine where
the cursor is, we get confused by the <br>s.

Auditors: eater, alex