build(aio): render titles correctly in content pages

If a document provided a title jsdoc tag then its h1
element was being rendered incorrectly as a markdown
paragraph.

This change renders the title as a markdown h1 tag
directly.

Fixes #16099
This commit is contained in:
Peter Bacon Darwin 2017-04-19 09:27:45 +01:00 committed by Pete Bacon Darwin
parent 9d40ab9e20
commit 648de7dd86
2 changed files with 8 additions and 1 deletions

View File

@ -49,6 +49,13 @@ describe('site App', function() {
});
});
describe('tutorial docs', () => {
it('should not render a paragraph element inside the h1 element', () => {
page.navigateTo('tutorial/toh-pt1');
expect(element(by.css('h1 p')).isPresent()).toBeFalsy();
});
});
describe('google analytics', () => {
beforeEach(done => page.gaReady.then(done));

View File

@ -1,4 +1,4 @@
{% if doc.title %}<h1>{$ doc.title | marked $}</h1>{% endif %}
{% if doc.title %}{$ ('# ' + doc.title.trim()) | marked $}{% endif %}
<div class="content">
{$ doc.description | marked $}
</div>