diff --git a/lib/generate/template.js b/lib/generate/template.js index 808217a64..e29464c7a 100644 --- a/lib/generate/template.js +++ b/lib/generate/template.js @@ -6,6 +6,10 @@ var parse = require("../parse"); var fs = require('./fs'); +swig.setFilter('lines', function(content) { + return content.split('\n').length; +}); + // return a templeter for page var initTemplate = function(options) { var tpl = swig.compileFile(path.resolve(__dirname, '../../templates/page.html')); diff --git a/templates/includes/book/exercise.html b/templates/includes/book/exercise.html index 8b1fd1f6f..5d721f983 100644 --- a/templates/includes/book/exercise.html +++ b/templates/includes/book/exercise.html @@ -12,7 +12,7 @@
{% autoescape false %}{{ section.content }}{% endautoescape %}
-
{{ section.code.base }}
+
{{ section.code.base }}