jgm/gitit — pull request #438 by wcaleb (2014-07-23 14:03:36+00:00)
Title: enable highlighting of patterns that start or end with punctuation

Improvements to `search.js` that account for search patterns bounded by punctuation.

- check to see if patt starts or ends with punctuation
- if it does, use lookarounds instead of \b for regex boundaries
- when replacing spaces in patterns with bar, preserve space after bar
(this accounts for patterns bounded by punctuation, which switches
on lookaround behavior, that also contain spaces)