diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-02-05 17:36:44 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-02-05 17:36:44 +0100 |
commit | 8cc0f64f54acae6fd16dbb7916029942a94fd46d (patch) | |
tree | d34b610725e420c4f6945db632eb757b99a25e6f /lib | |
parent | 532e8b0388eb19f5c3bedf8ea71ef2b7b077065b (diff) | |
download | gitbook-8cc0f64f54acae6fd16dbb7916029942a94fd46d.zip gitbook-8cc0f64f54acae6fd16dbb7916029942a94fd46d.tar.gz gitbook-8cc0f64f54acae6fd16dbb7916029942a94fd46d.tar.bz2 |
Handle SVG correctly in page normalization
Related to mathjax/MathJax-node#65
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/page.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js index f771f72..ec91e0b 100644 --- a/lib/utils/page.js +++ b/lib/utils/page.js @@ -78,7 +78,14 @@ function pregQuote( str ) { // Adapt an html snippet to be relative to a base folder function normalizeHtml(src, options) { - var $ = cheerio.load(src, { xmlMode: false}); + var $ = cheerio.load(src, { + // We should parse html without trying to normalize too much + xmlMode: false, + + // SVG need some attributes to use uppercases + lowerCaseAttributeNames: false, + lowerCaseTags: false + }); var toConvert = []; var svgContent = {}; var outputRoot = options.book.options.output; |