diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-23 21:10:53 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-23 21:10:53 +0200 |
commit | a3df6c6f0c1068762f9d48cdff97ab5d4c583082 (patch) | |
tree | e43d732f7676430d0075814e11fcb4372803e9da /lib/output/modifiers/editHTMLElement.js | |
parent | e1fa977b5b1b3c03790de6e2c21ee39ba55d9555 (diff) | |
download | gitbook-a3df6c6f0c1068762f9d48cdff97ab5d4c583082.zip gitbook-a3df6c6f0c1068762f9d48cdff97ab5d4c583082.tar.gz gitbook-a3df6c6f0c1068762f9d48cdff97ab5d4c583082.tar.bz2 |
Add assets inliner modifier for HTML
Diffstat (limited to 'lib/output/modifiers/editHTMLElement.js')
-rw-r--r-- | lib/output/modifiers/editHTMLElement.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/output/modifiers/editHTMLElement.js b/lib/output/modifiers/editHTMLElement.js new file mode 100644 index 0000000..9897dcc --- /dev/null +++ b/lib/output/modifiers/editHTMLElement.js @@ -0,0 +1,15 @@ +var Promise = require('../../utils/promise'); + +/** + Edit all elements matching a selector +*/ +function editHTMLElement($, selector, fn) { + var $elements = $(selector); + + return Promise.forEach($elements, function(el) { + var $el = $(el); + fn($el); + }); +} + +module.exports = editHTMLElement; |