Fixed GFM autocomplete to disallow non-word characters in string
## What does this MR do?
Disallows GFM autocomplete working when a non-word character is enter in the middle of the string.
## Screenshots (if relevant)
![Screen_Shot_2016-12-12_at_09.47.46](/uploads/aa6463a57b97c103c69eab6bb1d80540/Screen_Shot_2016-12-12_at_09.47.46.png)
## What are the relevant issue numbers?
Closes#25540
See merge request !8035