Fix wikitext warning: Get range from selection before trying to find start

Bug: 72475
Change-Id: Ib43d9c6b9b46be461354b3b5bbdf9d5de90887a6
(cherry picked from commit 4639a1c044b6f2f2c18d8205baaf9afb166e6f2b)