diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-14 22:49:55 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-14 22:49:55 +0100 |
commit | fef822145d43d80dbbefa8712eab88ad7044d6c1 (patch) | |
tree | 611af2ef4292e9e9a918c2840db2a65b7efdd587 /lib/page/html.js | |
parent | cfefa7d57992738373649dab16cbaf4754c3e5c7 (diff) | |
download | gitbook-fef822145d43d80dbbefa8712eab88ad7044d6c1.zip gitbook-fef822145d43d80dbbefa8712eab88ad7044d6c1.tar.gz gitbook-fef822145d43d80dbbefa8712eab88ad7044d6c1.tar.bz2 |
Move conrefs to a separate mixin
Diffstat (limited to 'lib/page/html.js')
-rw-r--r-- | lib/page/html.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/page/html.js b/lib/page/html.js index ea31a06..71b29b2 100644 --- a/lib/page/html.js +++ b/lib/page/html.js @@ -129,17 +129,19 @@ HTMLPipeline.prototype.transformHeadings = function() { // Outline SVG from the HML HTMLPipeline.prototype.transformSvgs = function() { + var that = this; + return this._transform('svg', function($svg) { var content = [ '<?xml version="1.0" encoding="UTF-8"?>', - renderDOM(this.$, $svg) + renderDOM(that.$, $svg) ].join('\n'); - return Promise(this.opts.onOutputSVG(content)) + return Promise(that.opts.onOutputSVG(content)) .then(function(filename) { if (!filename) return; - $svg.replaceWith(this.$('<img>').attr('src', filename)); + $svg.replaceWith(that.$('<img>').attr('src', filename)); }); }); }; |