/**
*
* showdown: https://github.com/showdownjs/showdown
*
* author: Di (微信小程序开发工程师)
* organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
* 垂直微信小程序开发交流社区
*
* github地址: https://github.com/icindy/wxParse
*
* for: 微信小程序富文本解析
* detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
*/
function getDefaultOpts(simple) {
'use strict';
var defaultOptions = {
omitExtraWLInCodeBlocks: {
defaultValue: false,
describe: 'Omit the default extra whiteline added to code blocks',
type: 'boolean'
},
noHeaderId: {
defaultValue: false,
describe: 'Turn on/off generated header id',
type: 'boolean'
},
prefixHeaderId: {
defaultValue: false,
describe: 'Specify a prefix to generated header ids',
type: 'string'
},
headerLevelStart: {
defaultValue: false,
describe: 'The header blocks level start',
type: 'integer'
},
parseImgDimensions: {
defaultValue: false,
describe: 'Turn on/off image dimension parsing',
type: 'boolean'
},
simplifiedAutoLink: {
defaultValue: false,
describe: 'Turn on/off GFM autolink style',
type: 'boolean'
},
literalMidWordUnderscores: {
defaultValue: false,
describe: 'Parse midword underscores as literal underscores',
type: 'boolean'
},
strikethrough: {
defaultValue: false,
describe: 'Turn on/off strikethrough support',
type: 'boolean'
},
tables: {
defaultValue: false,
describe: 'Turn on/off tables support',
type: 'boolean'
},
tablesHeaderId: {
defaultValue: false,
describe: 'Add an id to table headers',
type: 'boolean'
},
ghCodeBlocks: {
defaultValue: true,
describe: 'Turn on/off GFM fenced code blocks support',
type: 'boolean'
},
tasklists: {
defaultValue: false,
describe: 'Turn on/off GFM tasklist support',
type: 'boolean'
},
smoothLivePreview: {
defaultValue: false,
describe: 'Prevents weird effects in live previews due to incomplete input',
type: 'boolean'
},
smartIndentationFix: {
defaultValue: false,
description: 'Tries to smartly fix identation in es6 strings',
type: 'boolean'
}
};
if (simple === false) {
return JSON.parse(JSON.stringify(defaultOptions));
}
var ret = {};
for (var opt in defaultOptions) {
if (defaultOptions.hasOwnProperty(opt)) {
ret[opt] = defaultOptions[opt].defaultValue;
}
}
return ret;
}
/**
* Created by Tivie on 06-01-2015.
*/
// Private properties
var showdown = {},
parsers = {},
extensions = {},
globalOptions = getDefaultOpts(true),
flavor = {
github: {
omitExtraWLInCodeBlocks: true,
prefixHeaderId: 'user-content-',
simplifiedAutoLink: true,
literalMidWordUnderscores: true,
strikethrough: true,
tables: true,
tablesHeaderId: true,
ghCodeBlocks: true,
tasklists: true
},
vanilla: getDefaultOpts(true)
};
/**
* helper namespace
* @type {{}}
*/
showdown.helper = {};
/**
* TODO LEGACY SUPPORT CODE
* @type {{}}
*/
showdown.extensions = {};
/**
* Set a global option
* @static
* @param {string} key
* @param {*} value
* @returns {showdown}
*/
showdown.setOption = function (key, value) {
'use strict';
globalOptions[key] = value;
return this;
};
/**
* Get a global option
* @static
* @param {string} key
* @returns {*}
*/
showdown.getOption = function (key) {
'use strict';
return globalOptions[key];
};
/**
* Get the global options
* @static
* @returns {{}}
*/
showdown.getOptions = function () {
'use strict';
return globalOptions;
};
/**
* Reset global options to the default values
* @static
*/
showdown.resetOptions = function () {
'use strict';
globalOptions = getDefaultOpts(true);
};
/**
* Set the flavor showdown should use as default
* @param {string} name
*/
showdown.setFlavor = function (name) {
'use strict';
if (flavor.hasOwnProperty(name)) {
var preset = flavor[name];
for (var option in preset) {
if (preset.hasOwnProperty(option)) {
globalOptions[option] = preset[option];
}
}
}
};
/**
* Get the default options
* @static
* @param {boolean} [simple=true]
* @returns {{}}
*/
showdown.getDefaultOptions = function (simple) {
'use strict';
return getDefaultOpts(simple);
};
/**
* Get or set a subParser
*
* subParser(name) - Get a registered subParser
* subParser(name, func) - Register a subParser
* @static
* @param {string} name
* @param {function} [func]
* @returns {*}
*/
showdown.subParser = function (name, func) {
'use strict';
if (showdown.helper.isString(name)) {
if (typeof func !== 'undefined') {
parsers[name] = func;
} else {
if (parsers.hasOwnProperty(name)) {
return parsers[name];
} else {
throw Error('SubParser named ' + name + ' not registered!');
}
}
}
};
/**
* Gets or registers an extension
* @static
* @param {string} name
* @param {object|function=} ext
* @returns {*}
*/
showdown.extension = function (name, ext) {
'use strict';
if (!showdown.helper.isString(name)) {
throw Error('Extension \'name\' must be a string');
}
name = showdown.helper.stdExtName(name);
// Getter
if (showdown.helper.isUndefined(ext)) {
if (!extensions.hasOwnProperty(name)) {
throw Error('Extension named ' + name + ' is not registered!');
}
return extensions[name];
// Setter
} else {
// Expand extension if it's wrapped in a function
if (typeof ext === 'function') {
ext = ext();
}
// Ensure extension is an array
if (!showdown.helper.isArray(ext)) {
ext = [ext];
}
var validExtension = validate(ext, name);
if (validExtension.valid) {
extensions[name] = ext;
} else {
throw Error(validExtension.error);
}
}
};
/**
* Gets all extensions registered
* @returns {{}}
*/
showdown.getAllExtensions = function () {
'use strict';
return extensions;
};
/**
* Remove an extension
* @param {string} name
*/
showdown.removeExtension = function (name) {
'use strict';
delete extensions[name];
};
/**
* Removes all extensions
*/
showdown.resetExtensions = function () {
'use strict';
extensions = {};
};
/**
* Validate extension
* @param {array} extension
* @param {string} name
* @returns {{valid: boolean, error: string}}
*/
function validate(extension, name) {
'use strict';
var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
ret = {
valid: true,
error: ''
};
if (!showdown.helper.isArray(extension)) {
extension = [extension];
}
for (var i = 0; i < extension.length; ++i) {
var baseMsg = errMsg + ' sub-extension ' + i + ': ',
ext = extension[i];
if (typeof ext !== 'object') {
ret.valid = false;
ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
return ret;
}
if (!showdown.helper.isString(ext.type)) {
ret.valid = false;
ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
return ret;
}
var type = ext.type = ext.type.toLowerCase();
// normalize extension type
if (type === 'language') {
type = ext.type = 'lang';
}
if (type === 'html') {
type = ext.type = 'output';
}
if (type !== 'lang' && type !== 'output' && type !== 'listener') {
ret.valid = false;
ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
return ret;
}
没有合适的资源?快使用搜索试试~ 我知道了~
2024去水印小程序源码分享
共571个文件
js:68个
json:64个
wxml:61个
需积分: 5 0 下载量 12 浏览量
2024-08-20
17:06:55
上传
评论
收藏 598KB ZIP 举报
温馨提示
2024免费去水印小程序源码分享,无需后台,使用免费开源接口即可完成。
资源推荐
资源详情
资源评论
收起资源包目录
2024去水印小程序源码分享 (571个子文件)
0066039fcc8f6a2101a4bb6bad442b538d06ff 384B
01bef53dcf69368b11f7eb510ea1e70f3be7af 109B
027ccc4c8020b6fb12eb3128a079796188d83d 135B
02add20b581be471b8d17f887b8e8337070546 194B
02fe43ea00b6694560c77e35469551551ac144 549B
04712a6e9426faa5ca157728af6cca872d22e2 446B
04dd412ac38058a99cf37ea76830e5f0f27b24 52B
06b23fe00e8910c516a1b8001bc769632cf859 135B
071c3dc2d6ecbc7bc866c7b67cb45337de7e5b 134B
09ed73c7703a8441c6163f2854b7ed7286ee82 747B
0a68f9f612db0ad3b5806bda4b6f038bcdd8b9 134B
0bc8157105576c0868b6267432bffa77265da2 610B
0bfd1a7c54facddf7ee105dbad6191a34e892b 419B
0e44849c55771f61149f29c9d4536fab84489d 195B
0e74db436e560353a3e7ae549e54fa3fc1bda9 134B
0f39580552709937f7446a9cf31b3e57b14dcf 133B
10dee308b936dbe22519925c892d28a498dfa2 2KB
111d3e99c31761a1fcaadd3c52eb4f0199c55a 298B
13179d29f6387778fb7d412de29841d845fd44 134B
133cd64d80551ebfd1349df463f2bb3a676593 83B
14af9bbd793cae75ff0ce190ac705b9436cddf 172B
151850ed08365f649e5c517f697fd59ea27d72 125B
153bac0ee349c4f48266699c4356699b6a11e8 33B
15657d2b4af0a1366710e35601493c0106e820 2KB
15b7b3d630c5af8e7f21522cae993105d6a069 3KB
1658f09392eecd5e220e0b4a44870f9a763f00 381B
178e541a1769c71e152062e9471feabcabc8a6 476B
1a1282cbe958ac72d9ecd9e0043bfa810ca814 85B
1b67d7b7dcbdc03ff1f90f151a6f9d221c033b 302B
1be735a435757cf5fdbc9c06f2a895b85dca41 135B
1d51b8f8d5d40b8afbbae3f1191667d7af3697 134B
1d60499ce2a376417c1ce020e1c534d32fa12e 1KB
1ddacf4da4c462cee26f0c58bae1ab3a2e98c2 2KB
1e67d260928641a96238f8bc0980f932ab6e48 97B
20b791946c11913290cf83db7406423a76db76 191B
218ebb60fb6cb60d2a8f5141eb212a58f833ed 787B
22559e69d2831ae563ce79448d32351eb95ef5 134B
22b0af797b53750e71d3fd141cc3405aa0e204 231B
24713619c4b86fee5a25177b0dd57b0db0e26d 303B
247cc1116a5e62423cab62fea6db88e3b9f2a5 683B
24c1a43b052080d9fb2a5249d7b327db9de333 384B
25439f5902f82a53f8299b0d22d687f3121433 165B
283878937b6ad6ca1849320069167b913ca599 118B
287ea2489fcfe9bd085eac39a7f73810350d41 134B
28f0fc8942543760b5cca717687c94b2883ba3 164B
29d0aa1b9763ee8157837dd89e9c7ee1bbcfa0 135B
2a67bac69e740c73045d1e339f6ca6abd1a3db 134B
2b21189705c2616f176e1f29ebbf01434b5c2a 116B
2c675217e731ce2536a39b7fe882bd632de48c 388B
2ccb833b269003133fb34b32c947ec0e3a7eeb 903B
2d65d1275edbdf357700cc26d79835ee696663 171B
2ec165ede8efd0579d4964d6f35b6ceb7c5b0d 135B
2f393d274cf12e1f98abcb6b2fc485edd6d5c7 448B
2fc980ee687559c93c93f09350c4d2499af2a0 78B
2fccf1781bee9dc1b9e89c79f5da608bcc872e 136B
2fd7fe647de279f39172f1f42dbfcd4ccf9652 137B
309b150b9b89202db547ef84797a125a2a68bf 83B
3459fe3be99f455df16c110e9ae2d85d8529c1 3KB
35af0699ccec004cbe685ef938cd2d63ea7037 43B
36baad3f69ccb444bc28ed246febbb6114ecc0 307B
3748cc854e9a87c05b65b84eae0b439bbbdc4f 2KB
379f7f70f5910760b0e71233cb0249228afd83 82B
380d9e632498d44edf50183b0e763cb4eba37e 173B
39a2716b9c91ea21e5dc9af616d761d8390def 135B
39dc866de5168c3b46d5e344326153d8d4dca9 1KB
3a5c07ca063c8f984d4bf8117d85844a40b57f 166B
3afc0fe1c73ccb52b7e03f1a348d50fd4e8a78 84B
3b6410148f5b214f98a9218a19945089361664 818B
3bd7f42732f25ec6668ef8a03312e29ac4a713 420B
3c67395628aede0146eda858f590eb81596abd 105B
3d847b513f1d8a8da49cfe4c9be0adad318b8d 540B
3e06785a21cd7660285eb47c1768424dfa35c8 599B
3e7f0d106c0277a13dd3827483effb051688c4 1KB
3f9a695d3b02e6ff538258b997f5ca53be1b24 94B
401801c7c01bd4d9599799f1f9b1f6f4d555ca 63B
414dc10d86fa77aecb3f60159676097aa00c15 531B
415c1c7ea7fdd471e3bf7ce052ed2676a01158 445B
42f2097fb00fee2a52827356bde162e39383b2 683B
43ab9b2a7d7c87e4f6a47698c35fabf8da6ed8 152B
43dbdd1ea4a473b1354f2f253906a3afc71beb 993B
4493f867242c4250ba1cd1f7e0d6dc89c0f215 195B
44a0d2751afaa684be5d3aa919505055a2b6ef 142B
4b42acb91debcfe3377ac188d2346bd51cf9f9 588B
4c0322f2ce70a9b585ae606ee5db4df121f122 200B
4d47b83ad7993576f3742c5fefd06d26e65cc1 332B
4f1a9c1e7ff0846d9337ae6d97500437199c54 186B
503f49b802cf66788321bdb6427a092e3371c3 228B
512e168317fe05a24e877f9beded2ba9aa0cf2 132B
52e581fc02c9399bafceb3506edd4daea7f445 252B
53909546f391a5ea028cc4cb681c2e121c81d5 305B
547cc42f03caa6ea9d7e25c3741511fb47d318 367B
547f737af32f4494a8ab6d5af5597a60622647 134B
549dc0a95783334b06b0ddea785e74e4a874af 793B
54eeea69fca14a19020f42f980ab90827bde06 409B
5571a78a3fbe5396665f9766ff36275d8ed0cb 1KB
5637b7a095810714e175e24cdc3c3b9c05acec 287B
56d09350b2193aa2e8a68205783ba3f0558f16 134B
56f19800992f25783c6207540a2809fc77e863 2KB
571af6e1673e68ca37905c8832c6f4b2f8537f 192B
575da66c41d3b5c63bc47c873635f42d8cf897 82B
共 571 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Deeper520
- 粉丝: 358
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功