summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-html/lib/glossary.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook-html/lib/glossary.js')
-rwxr-xr-xpackages/gitbook-html/lib/glossary.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/gitbook-html/lib/glossary.js b/packages/gitbook-html/lib/glossary.js
index 648ba1a..9d3799b 100755
--- a/packages/gitbook-html/lib/glossary.js
+++ b/packages/gitbook-html/lib/glossary.js
@@ -7,9 +7,10 @@ function parseGlossary(html) {
var entries = [];
- $("h2").each(function() {
+ $('h2').each(function() {
var $heading = $(this);
- var $p = $heading.next();
+ var $next = $heading.next()
+ var $p = $next.is('p')? $next.first() : $next.find('p').first();
var entry = {};