elasticsearch/kibana — pull request #2422 by lukasolson (2014-12-19 21:03:55+00:00)
Title: Fix issues with adding word breaks and highlighting

Prior to this change, the `add_word_breaks` utility method would attempt to insert `` tags at certain intervals in text (when no natural word breaks occurred). However, this caused problems when there were highlighting markers (``) because `` tags could get inserted inside `` tags, causing funky (and invalid) nested tags.

This PR addresses the issue by only adding word breaks outside of HTML tags, and adds some tests around the behavior.

Closes #2415.