From 5a34464198f1ca108ddd085181a832d3aa181c31 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Mon, 20 May 2013 17:02:03 -0400 Subject: fix(ngdocs): fix gen_docs.sh --- docs/src/dom.js | 5 +++-- docs/src/ignore.words | 1 - docs/src/ngdoc.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'docs/src') diff --git a/docs/src/dom.js b/docs/src/dom.js index 1bb9578e..94048120 100644 --- a/docs/src/dom.js +++ b/docs/src/dom.js @@ -43,8 +43,9 @@ DOM.prototype = { var headingDepth = this.headingDepth; for ( var i = 10; i > 0; --i) { html = html - .replace(new RegExp('(<\/?h)' + i + '(>)', 'gm'), function(all, start, end){ - return start + (i + headingDepth) + end; + .replace(new RegExp('([\\s\\S]+)<\/h' + i +'>', 'gm'), function(_, attrs, content){ + var tag = 'h' + (i + headingDepth); + return '<' + tag + attrs + '>' + content + ''; }); } this.out.push(html); diff --git a/docs/src/ignore.words b/docs/src/ignore.words index d3af04b0..82b9f2fc 100644 --- a/docs/src/ignore.words +++ b/docs/src/ignore.words @@ -678,7 +678,6 @@ without won't wont words -world would wouldn't wouldnt diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 0b0bb340..7c07f00f 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -10,6 +10,7 @@ var NEW_LINE = /\n\r?/; var globalID = 0; var fs = require('fs'); var fspath = require('path'); +var markdown = new Showdown.converter({ extensions : ['table'] }); exports.trim = trim; exports.metadata = metadata; @@ -216,7 +217,7 @@ Doc.prototype = { }); }); text = parts.join(''); - text = new Showdown.converter({ extensions : ['table'] }).makeHtml(text); + text = markdown.makeHtml(text); text = text.replace(/(?:

)?(REPLACEME\d+)(?:<\/p>)?/g, function(_, id) { return placeholderMap[id]; }); -- cgit v1.2.3