diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-02-12 18:43:06 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-02-12 18:43:06 +0100 |
commit | 8d92b74e6152eb81d95b3494e5c864d9a0871ef3 (patch) | |
tree | e53a0989381f77796ed016a1233e8ee17b4e6787 /lib/utils | |
parent | 4e2cda99ccf80525ae8d8cb202e045d29cf913bd (diff) | |
download | gitbook-8d92b74e6152eb81d95b3494e5c864d9a0871ef3.zip gitbook-8d92b74e6152eb81d95b3494e5c864d9a0871ef3.tar.gz gitbook-8d92b74e6152eb81d95b3494e5c864d9a0871ef3.tar.bz2 |
Fix page normalization with empty links or images
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/page.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js index 20caf79..b072fcf 100644 --- a/lib/utils/page.js +++ b/lib/utils/page.js @@ -112,6 +112,7 @@ function normalizeHtml(src, options) { $("img").each(function() { var origin = undefined; var src = $(this).attr("src"); + if (!src) return; var isExternal = links.isExternal(src); // Transform as relative to the bases @@ -182,6 +183,7 @@ function normalizeHtml(src, options) { $("a").each(function() { var href = $(this).attr("href"); + if (!href) return; if (links.isRelative(href)) { var absolutePath = path.join(options.base, href); |