diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-08-19 16:10:02 -0700 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-08-19 16:10:02 -0700 |
commit | 4b390667e574ab46842821f029f3941d797a8b1a (patch) | |
tree | cfefdd61394268bd6f4255eff7414c8a03460c3a /theme/javascript/core/glossary.js | |
parent | 14dda3148d34f6168e25a0515b670193041e8d3b (diff) | |
download | gitbook-4b390667e574ab46842821f029f3941d797a8b1a.zip gitbook-4b390667e574ab46842821f029f3941d797a8b1a.tar.gz gitbook-4b390667e574ab46842821f029f3941d797a8b1a.tar.bz2 |
Replace whole word with glossary term
Diffstat (limited to 'theme/javascript/core/glossary.js')
-rw-r--r-- | theme/javascript/core/glossary.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/theme/javascript/core/glossary.js b/theme/javascript/core/glossary.js index 1d4300f..6e300e3 100644 --- a/theme/javascript/core/glossary.js +++ b/theme/javascript/core/glossary.js @@ -57,7 +57,7 @@ define([ }; var replaceTerm = function($el, term) { - var r = new RegExp( "(" + pregQuote(term.name.toLowerCase()) + ")" , 'gi' ); + var r = new RegExp( "\\b(" + pregQuote(term.name.toLowerCase()) + ")\\b" , 'gi' ); $el.find("p:contains('"+term.name+"')").each( function( i, element ) { element = $(element); |