summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-html/lib/glossary.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-19 16:12:43 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 12:32:14 +0100
commit4c44d677117d926b6dcc164f55fe34079c2ca3c7 (patch)
tree71d0fca56421f3a7b68d60a446f89d3735828f03 /packages/gitbook-html/lib/glossary.js
parent9e99b5850fd866fc2f9196993a0ae7e342311558 (diff)
downloadgitbook-4c44d677117d926b6dcc164f55fe34079c2ca3c7.zip
gitbook-4c44d677117d926b6dcc164f55fe34079c2ca3c7.tar.gz
gitbook-4c44d677117d926b6dcc164f55fe34079c2ca3c7.tar.bz2
Improve summary parser
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 = {};