mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Add support for a markdown.hardwrap config property
This commit is contained in:
parent
da14fedb69
commit
36717281ac
@ -97,6 +97,10 @@ function getParseFunction(parserName, conf) {
|
||||
conf = conf || {};
|
||||
|
||||
if (parserName === parserNames.marked) {
|
||||
if (conf.hardwrap) {
|
||||
marked.setOptions({breaks: true});
|
||||
}
|
||||
|
||||
// Marked generates an "id" attribute for headers; this custom renderer suppresses it
|
||||
markedRenderer = new marked.Renderer();
|
||||
|
||||
|
||||
@ -97,5 +97,13 @@ describe('jsdoc/util/markdown', function() {
|
||||
|
||||
expect(parser(markdownText)).toBe(convertedText);
|
||||
});
|
||||
|
||||
it('should hardwrap new lines when hardwrap is enabled', function() {
|
||||
var storage = setMarkdownConf({hardwrap: true});
|
||||
var parser = markdown.getParser();
|
||||
|
||||
expect(parser('line one\nline two')).toEqual(
|
||||
'<p>line one<br>line two</p>');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user