mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-20 17:43:24 +00:00
Improve output of page to text with frontmatter
This commit is contained in:
@@ -20,7 +20,7 @@ describe('Page', function() {
|
||||
})
|
||||
});
|
||||
|
||||
expect(page.toText()).toBe('---\nhello: world\n---\nHello World');
|
||||
expect(page.toText()).toBe('---\nhello: world\n---\n\nHello World');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ Page.prototype.toText = function() {
|
||||
return content;
|
||||
}
|
||||
|
||||
var frontMatter = '---\n' + yaml.safeDump(attrs.toJS(), { skipInvalid: true }) + '---\n';
|
||||
var frontMatter = '---\n' + yaml.safeDump(attrs.toJS(), { skipInvalid: true }) + '---\n\n';
|
||||
return (frontMatter + content);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user