fix: markdown json-parse

This commit is contained in:
suxiaoxin 2018-04-09 16:14:55 +08:00
parent 67aff23c25
commit a6c780f16f

View File

@ -1,6 +1,13 @@
const schema = require('./shema-transformTo-table.js');
const _ = require('underscore');
const json_parse = function(json){
try{
return JSON.parse(json);
}catch(err){
return {};
}
}
const messageMap = {
desc: '备注',
default: '实例',
@ -206,7 +213,7 @@ function tableBody(dataSource, columns, level) {
function createSchemaTable(body) {
let template = ``;
let dataSource = schema.schemaTransformToTable(JSON.parse(body));
let dataSource = schema.schemaTransformToTable(json_parse(body));
template += `<table>
<thead class="ant-table-thead">
<tr>