Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: blocks.js
omitExtraWLInCodeBlocks: {
[7500] Fix | Delete
defaultValue: false,
[7501] Fix | Delete
describe: 'Omit the default extra whiteline added to code blocks',
[7502] Fix | Delete
type: 'boolean'
[7503] Fix | Delete
},
[7504] Fix | Delete
noHeaderId: {
[7505] Fix | Delete
defaultValue: false,
[7506] Fix | Delete
describe: 'Turn on/off generated header id',
[7507] Fix | Delete
type: 'boolean'
[7508] Fix | Delete
},
[7509] Fix | Delete
prefixHeaderId: {
[7510] Fix | Delete
defaultValue: false,
[7511] Fix | Delete
describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \'section-\' prefix',
[7512] Fix | Delete
type: 'string'
[7513] Fix | Delete
},
[7514] Fix | Delete
rawPrefixHeaderId: {
[7515] Fix | Delete
defaultValue: false,
[7516] Fix | Delete
describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
[7517] Fix | Delete
type: 'boolean'
[7518] Fix | Delete
},
[7519] Fix | Delete
ghCompatibleHeaderId: {
[7520] Fix | Delete
defaultValue: false,
[7521] Fix | Delete
describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
[7522] Fix | Delete
type: 'boolean'
[7523] Fix | Delete
},
[7524] Fix | Delete
rawHeaderId: {
[7525] Fix | Delete
defaultValue: false,
[7526] Fix | Delete
describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
[7527] Fix | Delete
type: 'boolean'
[7528] Fix | Delete
},
[7529] Fix | Delete
headerLevelStart: {
[7530] Fix | Delete
defaultValue: false,
[7531] Fix | Delete
describe: 'The header blocks level start',
[7532] Fix | Delete
type: 'integer'
[7533] Fix | Delete
},
[7534] Fix | Delete
parseImgDimensions: {
[7535] Fix | Delete
defaultValue: false,
[7536] Fix | Delete
describe: 'Turn on/off image dimension parsing',
[7537] Fix | Delete
type: 'boolean'
[7538] Fix | Delete
},
[7539] Fix | Delete
simplifiedAutoLink: {
[7540] Fix | Delete
defaultValue: false,
[7541] Fix | Delete
describe: 'Turn on/off GFM autolink style',
[7542] Fix | Delete
type: 'boolean'
[7543] Fix | Delete
},
[7544] Fix | Delete
excludeTrailingPunctuationFromURLs: {
[7545] Fix | Delete
defaultValue: false,
[7546] Fix | Delete
describe: 'Excludes trailing punctuation from links generated with autoLinking',
[7547] Fix | Delete
type: 'boolean'
[7548] Fix | Delete
},
[7549] Fix | Delete
literalMidWordUnderscores: {
[7550] Fix | Delete
defaultValue: false,
[7551] Fix | Delete
describe: 'Parse midword underscores as literal underscores',
[7552] Fix | Delete
type: 'boolean'
[7553] Fix | Delete
},
[7554] Fix | Delete
literalMidWordAsterisks: {
[7555] Fix | Delete
defaultValue: false,
[7556] Fix | Delete
describe: 'Parse midword asterisks as literal asterisks',
[7557] Fix | Delete
type: 'boolean'
[7558] Fix | Delete
},
[7559] Fix | Delete
strikethrough: {
[7560] Fix | Delete
defaultValue: false,
[7561] Fix | Delete
describe: 'Turn on/off strikethrough support',
[7562] Fix | Delete
type: 'boolean'
[7563] Fix | Delete
},
[7564] Fix | Delete
tables: {
[7565] Fix | Delete
defaultValue: false,
[7566] Fix | Delete
describe: 'Turn on/off tables support',
[7567] Fix | Delete
type: 'boolean'
[7568] Fix | Delete
},
[7569] Fix | Delete
tablesHeaderId: {
[7570] Fix | Delete
defaultValue: false,
[7571] Fix | Delete
describe: 'Add an id to table headers',
[7572] Fix | Delete
type: 'boolean'
[7573] Fix | Delete
},
[7574] Fix | Delete
ghCodeBlocks: {
[7575] Fix | Delete
defaultValue: true,
[7576] Fix | Delete
describe: 'Turn on/off GFM fenced code blocks support',
[7577] Fix | Delete
type: 'boolean'
[7578] Fix | Delete
},
[7579] Fix | Delete
tasklists: {
[7580] Fix | Delete
defaultValue: false,
[7581] Fix | Delete
describe: 'Turn on/off GFM tasklist support',
[7582] Fix | Delete
type: 'boolean'
[7583] Fix | Delete
},
[7584] Fix | Delete
smoothLivePreview: {
[7585] Fix | Delete
defaultValue: false,
[7586] Fix | Delete
describe: 'Prevents weird effects in live previews due to incomplete input',
[7587] Fix | Delete
type: 'boolean'
[7588] Fix | Delete
},
[7589] Fix | Delete
smartIndentationFix: {
[7590] Fix | Delete
defaultValue: false,
[7591] Fix | Delete
description: 'Tries to smartly fix indentation in es6 strings',
[7592] Fix | Delete
type: 'boolean'
[7593] Fix | Delete
},
[7594] Fix | Delete
disableForced4SpacesIndentedSublists: {
[7595] Fix | Delete
defaultValue: false,
[7596] Fix | Delete
description: 'Disables the requirement of indenting nested sublists by 4 spaces',
[7597] Fix | Delete
type: 'boolean'
[7598] Fix | Delete
},
[7599] Fix | Delete
simpleLineBreaks: {
[7600] Fix | Delete
defaultValue: false,
[7601] Fix | Delete
description: 'Parses simple line breaks as <br> (GFM Style)',
[7602] Fix | Delete
type: 'boolean'
[7603] Fix | Delete
},
[7604] Fix | Delete
requireSpaceBeforeHeadingText: {
[7605] Fix | Delete
defaultValue: false,
[7606] Fix | Delete
description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
[7607] Fix | Delete
type: 'boolean'
[7608] Fix | Delete
},
[7609] Fix | Delete
ghMentions: {
[7610] Fix | Delete
defaultValue: false,
[7611] Fix | Delete
description: 'Enables github @mentions',
[7612] Fix | Delete
type: 'boolean'
[7613] Fix | Delete
},
[7614] Fix | Delete
ghMentionsLink: {
[7615] Fix | Delete
defaultValue: 'https://github.com/{u}',
[7616] Fix | Delete
description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
[7617] Fix | Delete
type: 'string'
[7618] Fix | Delete
},
[7619] Fix | Delete
encodeEmails: {
[7620] Fix | Delete
defaultValue: true,
[7621] Fix | Delete
description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
[7622] Fix | Delete
type: 'boolean'
[7623] Fix | Delete
},
[7624] Fix | Delete
openLinksInNewWindow: {
[7625] Fix | Delete
defaultValue: false,
[7626] Fix | Delete
description: 'Open all links in new windows',
[7627] Fix | Delete
type: 'boolean'
[7628] Fix | Delete
},
[7629] Fix | Delete
backslashEscapesHTMLTags: {
[7630] Fix | Delete
defaultValue: false,
[7631] Fix | Delete
description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>',
[7632] Fix | Delete
type: 'boolean'
[7633] Fix | Delete
},
[7634] Fix | Delete
emoji: {
[7635] Fix | Delete
defaultValue: false,
[7636] Fix | Delete
description: 'Enable emoji support. Ex: `this is a :smile: emoji`',
[7637] Fix | Delete
type: 'boolean'
[7638] Fix | Delete
},
[7639] Fix | Delete
underline: {
[7640] Fix | Delete
defaultValue: false,
[7641] Fix | Delete
description: 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`',
[7642] Fix | Delete
type: 'boolean'
[7643] Fix | Delete
},
[7644] Fix | Delete
completeHTMLDocument: {
[7645] Fix | Delete
defaultValue: false,
[7646] Fix | Delete
description: 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags',
[7647] Fix | Delete
type: 'boolean'
[7648] Fix | Delete
},
[7649] Fix | Delete
metadata: {
[7650] Fix | Delete
defaultValue: false,
[7651] Fix | Delete
description: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',
[7652] Fix | Delete
type: 'boolean'
[7653] Fix | Delete
},
[7654] Fix | Delete
splitAdjacentBlockquotes: {
[7655] Fix | Delete
defaultValue: false,
[7656] Fix | Delete
description: 'Split adjacent blockquote blocks',
[7657] Fix | Delete
type: 'boolean'
[7658] Fix | Delete
}
[7659] Fix | Delete
};
[7660] Fix | Delete
if (simple === false) {
[7661] Fix | Delete
return JSON.parse(JSON.stringify(defaultOptions));
[7662] Fix | Delete
}
[7663] Fix | Delete
var ret = {};
[7664] Fix | Delete
for (var opt in defaultOptions) {
[7665] Fix | Delete
if (defaultOptions.hasOwnProperty(opt)) {
[7666] Fix | Delete
ret[opt] = defaultOptions[opt].defaultValue;
[7667] Fix | Delete
}
[7668] Fix | Delete
}
[7669] Fix | Delete
return ret;
[7670] Fix | Delete
}
[7671] Fix | Delete
[7672] Fix | Delete
function allOptionsOn () {
[7673] Fix | Delete
'use strict';
[7674] Fix | Delete
var options = getDefaultOpts(true),
[7675] Fix | Delete
ret = {};
[7676] Fix | Delete
for (var opt in options) {
[7677] Fix | Delete
if (options.hasOwnProperty(opt)) {
[7678] Fix | Delete
ret[opt] = true;
[7679] Fix | Delete
}
[7680] Fix | Delete
}
[7681] Fix | Delete
return ret;
[7682] Fix | Delete
}
[7683] Fix | Delete
[7684] Fix | Delete
/**
[7685] Fix | Delete
* Created by Tivie on 06-01-2015.
[7686] Fix | Delete
*/
[7687] Fix | Delete
[7688] Fix | Delete
// Private properties
[7689] Fix | Delete
var showdown = {},
[7690] Fix | Delete
parsers = {},
[7691] Fix | Delete
extensions = {},
[7692] Fix | Delete
globalOptions = getDefaultOpts(true),
[7693] Fix | Delete
setFlavor = 'vanilla',
[7694] Fix | Delete
flavor = {
[7695] Fix | Delete
github: {
[7696] Fix | Delete
omitExtraWLInCodeBlocks: true,
[7697] Fix | Delete
simplifiedAutoLink: true,
[7698] Fix | Delete
excludeTrailingPunctuationFromURLs: true,
[7699] Fix | Delete
literalMidWordUnderscores: true,
[7700] Fix | Delete
strikethrough: true,
[7701] Fix | Delete
tables: true,
[7702] Fix | Delete
tablesHeaderId: true,
[7703] Fix | Delete
ghCodeBlocks: true,
[7704] Fix | Delete
tasklists: true,
[7705] Fix | Delete
disableForced4SpacesIndentedSublists: true,
[7706] Fix | Delete
simpleLineBreaks: true,
[7707] Fix | Delete
requireSpaceBeforeHeadingText: true,
[7708] Fix | Delete
ghCompatibleHeaderId: true,
[7709] Fix | Delete
ghMentions: true,
[7710] Fix | Delete
backslashEscapesHTMLTags: true,
[7711] Fix | Delete
emoji: true,
[7712] Fix | Delete
splitAdjacentBlockquotes: true
[7713] Fix | Delete
},
[7714] Fix | Delete
original: {
[7715] Fix | Delete
noHeaderId: true,
[7716] Fix | Delete
ghCodeBlocks: false
[7717] Fix | Delete
},
[7718] Fix | Delete
ghost: {
[7719] Fix | Delete
omitExtraWLInCodeBlocks: true,
[7720] Fix | Delete
parseImgDimensions: true,
[7721] Fix | Delete
simplifiedAutoLink: true,
[7722] Fix | Delete
excludeTrailingPunctuationFromURLs: true,
[7723] Fix | Delete
literalMidWordUnderscores: true,
[7724] Fix | Delete
strikethrough: true,
[7725] Fix | Delete
tables: true,
[7726] Fix | Delete
tablesHeaderId: true,
[7727] Fix | Delete
ghCodeBlocks: true,
[7728] Fix | Delete
tasklists: true,
[7729] Fix | Delete
smoothLivePreview: true,
[7730] Fix | Delete
simpleLineBreaks: true,
[7731] Fix | Delete
requireSpaceBeforeHeadingText: true,
[7732] Fix | Delete
ghMentions: false,
[7733] Fix | Delete
encodeEmails: true
[7734] Fix | Delete
},
[7735] Fix | Delete
vanilla: getDefaultOpts(true),
[7736] Fix | Delete
allOn: allOptionsOn()
[7737] Fix | Delete
};
[7738] Fix | Delete
[7739] Fix | Delete
/**
[7740] Fix | Delete
* helper namespace
[7741] Fix | Delete
* @type {{}}
[7742] Fix | Delete
*/
[7743] Fix | Delete
showdown.helper = {};
[7744] Fix | Delete
[7745] Fix | Delete
/**
[7746] Fix | Delete
* TODO LEGACY SUPPORT CODE
[7747] Fix | Delete
* @type {{}}
[7748] Fix | Delete
*/
[7749] Fix | Delete
showdown.extensions = {};
[7750] Fix | Delete
[7751] Fix | Delete
/**
[7752] Fix | Delete
* Set a global option
[7753] Fix | Delete
* @static
[7754] Fix | Delete
* @param {string} key
[7755] Fix | Delete
* @param {*} value
[7756] Fix | Delete
* @returns {showdown}
[7757] Fix | Delete
*/
[7758] Fix | Delete
showdown.setOption = function (key, value) {
[7759] Fix | Delete
'use strict';
[7760] Fix | Delete
globalOptions[key] = value;
[7761] Fix | Delete
return this;
[7762] Fix | Delete
};
[7763] Fix | Delete
[7764] Fix | Delete
/**
[7765] Fix | Delete
* Get a global option
[7766] Fix | Delete
* @static
[7767] Fix | Delete
* @param {string} key
[7768] Fix | Delete
* @returns {*}
[7769] Fix | Delete
*/
[7770] Fix | Delete
showdown.getOption = function (key) {
[7771] Fix | Delete
'use strict';
[7772] Fix | Delete
return globalOptions[key];
[7773] Fix | Delete
};
[7774] Fix | Delete
[7775] Fix | Delete
/**
[7776] Fix | Delete
* Get the global options
[7777] Fix | Delete
* @static
[7778] Fix | Delete
* @returns {{}}
[7779] Fix | Delete
*/
[7780] Fix | Delete
showdown.getOptions = function () {
[7781] Fix | Delete
'use strict';
[7782] Fix | Delete
return globalOptions;
[7783] Fix | Delete
};
[7784] Fix | Delete
[7785] Fix | Delete
/**
[7786] Fix | Delete
* Reset global options to the default values
[7787] Fix | Delete
* @static
[7788] Fix | Delete
*/
[7789] Fix | Delete
showdown.resetOptions = function () {
[7790] Fix | Delete
'use strict';
[7791] Fix | Delete
globalOptions = getDefaultOpts(true);
[7792] Fix | Delete
};
[7793] Fix | Delete
[7794] Fix | Delete
/**
[7795] Fix | Delete
* Set the flavor showdown should use as default
[7796] Fix | Delete
* @param {string} name
[7797] Fix | Delete
*/
[7798] Fix | Delete
showdown.setFlavor = function (name) {
[7799] Fix | Delete
'use strict';
[7800] Fix | Delete
if (!flavor.hasOwnProperty(name)) {
[7801] Fix | Delete
throw Error(name + ' flavor was not found');
[7802] Fix | Delete
}
[7803] Fix | Delete
showdown.resetOptions();
[7804] Fix | Delete
var preset = flavor[name];
[7805] Fix | Delete
setFlavor = name;
[7806] Fix | Delete
for (var option in preset) {
[7807] Fix | Delete
if (preset.hasOwnProperty(option)) {
[7808] Fix | Delete
globalOptions[option] = preset[option];
[7809] Fix | Delete
}
[7810] Fix | Delete
}
[7811] Fix | Delete
};
[7812] Fix | Delete
[7813] Fix | Delete
/**
[7814] Fix | Delete
* Get the currently set flavor
[7815] Fix | Delete
* @returns {string}
[7816] Fix | Delete
*/
[7817] Fix | Delete
showdown.getFlavor = function () {
[7818] Fix | Delete
'use strict';
[7819] Fix | Delete
return setFlavor;
[7820] Fix | Delete
};
[7821] Fix | Delete
[7822] Fix | Delete
/**
[7823] Fix | Delete
* Get the options of a specified flavor. Returns undefined if the flavor was not found
[7824] Fix | Delete
* @param {string} name Name of the flavor
[7825] Fix | Delete
* @returns {{}|undefined}
[7826] Fix | Delete
*/
[7827] Fix | Delete
showdown.getFlavorOptions = function (name) {
[7828] Fix | Delete
'use strict';
[7829] Fix | Delete
if (flavor.hasOwnProperty(name)) {
[7830] Fix | Delete
return flavor[name];
[7831] Fix | Delete
}
[7832] Fix | Delete
};
[7833] Fix | Delete
[7834] Fix | Delete
/**
[7835] Fix | Delete
* Get the default options
[7836] Fix | Delete
* @static
[7837] Fix | Delete
* @param {boolean} [simple=true]
[7838] Fix | Delete
* @returns {{}}
[7839] Fix | Delete
*/
[7840] Fix | Delete
showdown.getDefaultOptions = function (simple) {
[7841] Fix | Delete
'use strict';
[7842] Fix | Delete
return getDefaultOpts(simple);
[7843] Fix | Delete
};
[7844] Fix | Delete
[7845] Fix | Delete
/**
[7846] Fix | Delete
* Get or set a subParser
[7847] Fix | Delete
*
[7848] Fix | Delete
* subParser(name) - Get a registered subParser
[7849] Fix | Delete
* subParser(name, func) - Register a subParser
[7850] Fix | Delete
* @static
[7851] Fix | Delete
* @param {string} name
[7852] Fix | Delete
* @param {function} [func]
[7853] Fix | Delete
* @returns {*}
[7854] Fix | Delete
*/
[7855] Fix | Delete
showdown.subParser = function (name, func) {
[7856] Fix | Delete
'use strict';
[7857] Fix | Delete
if (showdown.helper.isString(name)) {
[7858] Fix | Delete
if (typeof func !== 'undefined') {
[7859] Fix | Delete
parsers[name] = func;
[7860] Fix | Delete
} else {
[7861] Fix | Delete
if (parsers.hasOwnProperty(name)) {
[7862] Fix | Delete
return parsers[name];
[7863] Fix | Delete
} else {
[7864] Fix | Delete
throw Error('SubParser named ' + name + ' not registered!');
[7865] Fix | Delete
}
[7866] Fix | Delete
}
[7867] Fix | Delete
}
[7868] Fix | Delete
};
[7869] Fix | Delete
[7870] Fix | Delete
/**
[7871] Fix | Delete
* Gets or registers an extension
[7872] Fix | Delete
* @static
[7873] Fix | Delete
* @param {string} name
[7874] Fix | Delete
* @param {object|function=} ext
[7875] Fix | Delete
* @returns {*}
[7876] Fix | Delete
*/
[7877] Fix | Delete
showdown.extension = function (name, ext) {
[7878] Fix | Delete
'use strict';
[7879] Fix | Delete
[7880] Fix | Delete
if (!showdown.helper.isString(name)) {
[7881] Fix | Delete
throw Error('Extension \'name\' must be a string');
[7882] Fix | Delete
}
[7883] Fix | Delete
[7884] Fix | Delete
name = showdown.helper.stdExtName(name);
[7885] Fix | Delete
[7886] Fix | Delete
// Getter
[7887] Fix | Delete
if (showdown.helper.isUndefined(ext)) {
[7888] Fix | Delete
if (!extensions.hasOwnProperty(name)) {
[7889] Fix | Delete
throw Error('Extension named ' + name + ' is not registered!');
[7890] Fix | Delete
}
[7891] Fix | Delete
return extensions[name];
[7892] Fix | Delete
[7893] Fix | Delete
// Setter
[7894] Fix | Delete
} else {
[7895] Fix | Delete
// Expand extension if it's wrapped in a function
[7896] Fix | Delete
if (typeof ext === 'function') {
[7897] Fix | Delete
ext = ext();
[7898] Fix | Delete
}
[7899] Fix | Delete
[7900] Fix | Delete
// Ensure extension is an array
[7901] Fix | Delete
if (!showdown.helper.isArray(ext)) {
[7902] Fix | Delete
ext = [ext];
[7903] Fix | Delete
}
[7904] Fix | Delete
[7905] Fix | Delete
var validExtension = validate(ext, name);
[7906] Fix | Delete
[7907] Fix | Delete
if (validExtension.valid) {
[7908] Fix | Delete
extensions[name] = ext;
[7909] Fix | Delete
} else {
[7910] Fix | Delete
throw Error(validExtension.error);
[7911] Fix | Delete
}
[7912] Fix | Delete
}
[7913] Fix | Delete
};
[7914] Fix | Delete
[7915] Fix | Delete
/**
[7916] Fix | Delete
* Gets all extensions registered
[7917] Fix | Delete
* @returns {{}}
[7918] Fix | Delete
*/
[7919] Fix | Delete
showdown.getAllExtensions = function () {
[7920] Fix | Delete
'use strict';
[7921] Fix | Delete
return extensions;
[7922] Fix | Delete
};
[7923] Fix | Delete
[7924] Fix | Delete
/**
[7925] Fix | Delete
* Remove an extension
[7926] Fix | Delete
* @param {string} name
[7927] Fix | Delete
*/
[7928] Fix | Delete
showdown.removeExtension = function (name) {
[7929] Fix | Delete
'use strict';
[7930] Fix | Delete
delete extensions[name];
[7931] Fix | Delete
};
[7932] Fix | Delete
[7933] Fix | Delete
/**
[7934] Fix | Delete
* Removes all extensions
[7935] Fix | Delete
*/
[7936] Fix | Delete
showdown.resetExtensions = function () {
[7937] Fix | Delete
'use strict';
[7938] Fix | Delete
extensions = {};
[7939] Fix | Delete
};
[7940] Fix | Delete
[7941] Fix | Delete
/**
[7942] Fix | Delete
* Validate extension
[7943] Fix | Delete
* @param {array} extension
[7944] Fix | Delete
* @param {string} name
[7945] Fix | Delete
* @returns {{valid: boolean, error: string}}
[7946] Fix | Delete
*/
[7947] Fix | Delete
function validate (extension, name) {
[7948] Fix | Delete
'use strict';
[7949] Fix | Delete
[7950] Fix | Delete
var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
[7951] Fix | Delete
ret = {
[7952] Fix | Delete
valid: true,
[7953] Fix | Delete
error: ''
[7954] Fix | Delete
};
[7955] Fix | Delete
[7956] Fix | Delete
if (!showdown.helper.isArray(extension)) {
[7957] Fix | Delete
extension = [extension];
[7958] Fix | Delete
}
[7959] Fix | Delete
[7960] Fix | Delete
for (var i = 0; i < extension.length; ++i) {
[7961] Fix | Delete
var baseMsg = errMsg + ' sub-extension ' + i + ': ',
[7962] Fix | Delete
ext = extension[i];
[7963] Fix | Delete
if (typeof ext !== 'object') {
[7964] Fix | Delete
ret.valid = false;
[7965] Fix | Delete
ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
[7966] Fix | Delete
return ret;
[7967] Fix | Delete
}
[7968] Fix | Delete
[7969] Fix | Delete
if (!showdown.helper.isString(ext.type)) {
[7970] Fix | Delete
ret.valid = false;
[7971] Fix | Delete
ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
[7972] Fix | Delete
return ret;
[7973] Fix | Delete
}
[7974] Fix | Delete
[7975] Fix | Delete
var type = ext.type = ext.type.toLowerCase();
[7976] Fix | Delete
[7977] Fix | Delete
// normalize extension type
[7978] Fix | Delete
if (type === 'language') {
[7979] Fix | Delete
type = ext.type = 'lang';
[7980] Fix | Delete
}
[7981] Fix | Delete
[7982] Fix | Delete
if (type === 'html') {
[7983] Fix | Delete
type = ext.type = 'output';
[7984] Fix | Delete
}
[7985] Fix | Delete
[7986] Fix | Delete
if (type !== 'lang' && type !== 'output' && type !== 'listener') {
[7987] Fix | Delete
ret.valid = false;
[7988] Fix | Delete
ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
[7989] Fix | Delete
return ret;
[7990] Fix | Delete
}
[7991] Fix | Delete
[7992] Fix | Delete
if (type === 'listener') {
[7993] Fix | Delete
if (showdown.helper.isUndefined(ext.listeners)) {
[7994] Fix | Delete
ret.valid = false;
[7995] Fix | Delete
ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
[7996] Fix | Delete
return ret;
[7997] Fix | Delete
}
[7998] Fix | Delete
} else {
[7999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function