互联网YAML智能程式

Yaml在线格式化、转换JSON、XML、CSV、HTML 格式,YAML在线校验

tool.p2hp.com Yaml To HTML Converter "; var endhtml = "
xxfseo.com
" output = starthtml + output + endhtml; return (html_beautify(output, opts)); } catch (e) { errorData = ""; errorData = errorData + "Error : " + e['message']; if (e['parsedLine'] != undefined) { errorData = errorData + "\n"; errorData = errorData + "Line : " + e['parsedLine'] + " " + e['snippet']; } return (errorData); } } function yaml_csv(data) { try { obj = YAML.parse(data); json = JSON.stringify(obj); return (jsonToCsv(json, ",", true, false, false)); } catch (e) { errorData = ""; errorData = errorData + "Error : " + e['message']; if (e['parsedLine'] != undefined) { errorData = errorData + "\n"; errorData = errorData + "Line : " + e['parsedLine'] + " " + e['snippet']; } return (errorData); } } $(function() { var sourceArea = toolfk.create_codeMirror('code', 'text/x-yaml'); var targetArea = toolfk.create_codeMirror('result', 'javascript'); $(".btn-convert").click(function() { if (toolfk.beautify_default.beautify_in_progress) { return; } var source = sourceArea.getValue(); if (source == '') { return layer.msg('内容不能空.'); } toolfk.beautify_default.beautify_in_progress = true; try { var func_method = $(this).data("func"); var func = eval(func_method); var result = func(source); targetArea.setValue(result); } catch (e) { targetArea.setValue(e.message); } toolfk.beautify_default.beautify_in_progress = false; }); $(".copy-code").click(function() { toolfk.code_code({ source: sourceArea, target: targetArea, }); }); });