调整分包,完成隐私协议(样式待优化)
This commit is contained in:
19
childPackage/miniprogram_npm/towxml/index.js
Normal file
19
childPackage/miniprogram_npm/towxml/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const md = require('./parse/markdown/index'),
|
||||
parse = require('./parse/index')
|
||||
|
||||
module.exports = (str,type,option)=>{
|
||||
option = option || {};
|
||||
let result;
|
||||
switch (type) {
|
||||
case 'markdown':
|
||||
result = parse(md(str),option);
|
||||
break;
|
||||
case 'html':
|
||||
result = parse(str,option);
|
||||
break;
|
||||
default:
|
||||
throw new Error('Invalid type, only markdown and html are supported');
|
||||
break;
|
||||
};
|
||||
return result;
|
||||
};
|
Reference in New Issue
Block a user