Skip to content

Commit 1fadf74

Browse files
committed
Allow codeBlocks to be extended via options.
1 parent f78dcd7 commit 1fadf74

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var Promise = require('bluebird'),
66

77
module.exports = function (html, options) {
88
return new Promise(function (resolve, reject) {
9-
var opt = extend({
9+
var opt = extend(true, {
1010
extraCss: '',
1111
applyStyleTags: true,
1212
removeStyleTags: true,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<h1><<Hi>></h1>
5+
</body>
6+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<h1><<Hi>></h1>
5+
</body>
6+
</html>

test/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,14 @@ describe('inline-css', function() {
284284
};
285285
compare(path.join('test', 'fixtures', 'ejs.html'), path.join('test', 'expected', 'ejs.html'), options, done);
286286
});
287+
288+
it('Should ignore user defined code blocks', function(done) {
289+
var options = {
290+
xmlMode: true,
291+
codeBlocks: {
292+
craze: { start: '<<', end: '>>' }
293+
}
294+
};
295+
compare(path.join('test', 'fixtures', 'codeblocks-external.html'), path.join('test', 'expected', 'codeblocks-external.html'), options, done);
296+
});
287297
});

0 commit comments

Comments
 (0)