diff --git a/docs/spec/domSpec.js b/docs/spec/domSpec.js
index af1a8faa..58063789 100644
--- a/docs/spec/domSpec.js
+++ b/docs/spec/domSpec.js
@@ -5,13 +5,24 @@ describe('dom', function(){
it('should render code, live, test', function(){
var dom = new DOM();
dom.example('desc', 'src', 'scenario');
- expect(dom.toString()).toEqual('
Example
\ndescsrc\nscenario\n\n');
+ expect(dom.toString()).toEqual(
+ 'Example
\n' +
+ '' +
+ 'descsrc\n' +
+ 'scenario\n'+
+ '\n' +
+ '
\n');
});
it('should render non-live, test with description', function(){
var dom = new DOM();
dom.example('desc', 'src', false);
- expect(dom.toString()).toEqual('Example
\ndesc\n');
+ expect(dom.toString()).toEqual('Example
\n' +
+ '\n');
});
it('should render non-live, test', function(){
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js
index 2bea6e9a..8f57e329 100644
--- a/docs/spec/ngdocSpec.js
+++ b/docs/spec/ngdocSpec.js
@@ -304,7 +304,12 @@ describe('ngdoc', function(){
var doc = new Doc('@this I am self.');
doc.ngdoc = 'filter';
doc.parse();
- expect(doc.html()).toContain('Method\'s this
\nI am self.
');
+ expect(doc.html()).toContain('Method\'s this
\n' +
+ '\n');
+ expect(doc.html()).toContain('Method\'s this
\n' +
+ '');
});
});
});
diff --git a/docs/src/dom.js b/docs/src/dom.js
index d7c2a157..fedd4e19 100644
--- a/docs/src/dom.js
+++ b/docs/src/dom.js
@@ -82,7 +82,9 @@ DOM.prototype = {
if (content==undefined || content && content.legth == 0) return;
this.tag('h' + this.headingDepth, heading);
this.headingDepth++;
- var className = {'class': heading.toLowerCase()};
+ var className = typeof heading == 'string'
+ ? {'class': heading.toLowerCase().replace(/[^\d\w_]/, '-')}
+ : null;
if (content instanceof Array) {
this.ul(content, className, fn);
} else if (fn) {