2015-07-13 12:09:03 +08:00
|
|
|
/**
|
|
|
|
* Created by Tivie on 13-07-2015.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function getDefaultOpts(simple) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var defaultOptions = {
|
|
|
|
omitExtraWLInCodeBlocks: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Omit the default extra whiteline added to code blocks',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
noHeaderId: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Turn on/off generated header id',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
prefixHeaderId: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Specify a prefix to generated header ids',
|
|
|
|
type: 'string'
|
|
|
|
},
|
|
|
|
headerLevelStart: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'The header blocks level start',
|
|
|
|
type: 'integer'
|
|
|
|
},
|
|
|
|
parseImgDimensions: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Turn on/off image dimension parsing',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
simplifiedAutoLink: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Turn on/off GFM autolink style',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
2016-12-01 23:25:46 +08:00
|
|
|
excludeTrailingPunctuationFromURLs: {
|
|
|
|
defaultValue: false,
|
|
|
|
describe: 'Excludes trailing punctuation from links generated with autoLinking',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
2015-07-13 12:09:03 +08:00
|
|
|
literalMidWordUnderscores: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Parse midword underscores as literal underscores',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
strikethrough: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Turn on/off strikethrough support',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
tables: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Turn on/off tables support',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
tablesHeaderId: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Add an id to table headers',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
ghCodeBlocks: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: true,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Turn on/off GFM fenced code blocks support',
|
|
|
|
type: 'boolean'
|
|
|
|
},
|
|
|
|
tasklists: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-13 12:09:03 +08:00
|
|
|
describe: 'Turn on/off GFM tasklist support',
|
|
|
|
type: 'boolean'
|
2015-07-15 00:10:52 +08:00
|
|
|
},
|
|
|
|
smoothLivePreview: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2015-07-15 00:10:52 +08:00
|
|
|
describe: 'Prevents weird effects in live previews due to incomplete input',
|
|
|
|
type: 'boolean'
|
2016-06-07 08:23:52 +08:00
|
|
|
},
|
|
|
|
smartIndentationFix: {
|
2016-07-21 05:26:15 +08:00
|
|
|
defaultValue: false,
|
2016-11-11 15:57:56 +08:00
|
|
|
description: 'Tries to smartly fix indentation in es6 strings',
|
2016-06-07 08:23:52 +08:00
|
|
|
type: 'boolean'
|
2016-11-11 16:15:24 +08:00
|
|
|
},
|
|
|
|
disableForced4SpacesIndentedSublists: {
|
|
|
|
defaultValue: false,
|
|
|
|
description: 'Disables the requirement of indenting nested sublists by 4 spaces',
|
|
|
|
type: 'boolean'
|
2016-12-01 02:04:17 +08:00
|
|
|
},
|
|
|
|
simpleLineBreaks: {
|
|
|
|
defaultValue: false,
|
|
|
|
description: 'Parses simple line breaks as <br> (GFM Style)',
|
|
|
|
type: 'boolean'
|
2016-12-17 14:01:15 +08:00
|
|
|
},
|
|
|
|
requireSpaceBeforeHeadingText: {
|
|
|
|
defaultValue: false,
|
|
|
|
description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
|
|
|
|
type: 'boolean'
|
2015-07-13 12:09:03 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
if (simple === false) {
|
|
|
|
return JSON.parse(JSON.stringify(defaultOptions));
|
|
|
|
}
|
|
|
|
var ret = {};
|
|
|
|
for (var opt in defaultOptions) {
|
|
|
|
if (defaultOptions.hasOwnProperty(opt)) {
|
2016-07-21 05:26:15 +08:00
|
|
|
ret[opt] = defaultOptions[opt].defaultValue;
|
2015-07-13 12:09:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|