diff options
Diffstat (limited to 'docs/src/dom.js')
| -rw-r--r-- | docs/src/dom.js | 5 |
1 files changed, 3 insertions, 2 deletions
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('<h' + i + '(.*?)>([\\s\\S]+)<\/h' + i +'>', 'gm'), function(_, attrs, content){ + var tag = 'h' + (i + headingDepth); + return '<' + tag + attrs + '>' + content + '</' + tag + '>'; }); } this.out.push(html); |
