Skip to content

Commit

Permalink
Fixes #68
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Sep 14, 2012
1 parent f0c85bb commit b7f48fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ YUI.add('doc-builder', function(Y) {
*/
markdown: function(md, def, tags) {
html = MD(md, def, tags);
if (html.indexOf('{{#') > -1) { //Only reprocess with Handlebars if we see a helper
//Only reprocess if helpers were asked for
if (this.options.helpers) {
//console.log('MD: ', html);
try {
html = (Y.Handlebars.compile(html))({});
} catch (e) {
} catch (hError) {
//Remove all the extra escapes
html = html.replace(/\\{/g, '{').replace(/\\}/g, '}');
Y.log('Failed to parse Handlebars, probably an unknown helper, skipping..', 'warn', 'builder');
}
//console.log('HB: ', html);
Expand Down

0 comments on commit b7f48fa

Please sign in to comment.