Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleSaveMeta(data) {
if (data === this.state.head) {
console.log('[log]: 没有修改');
return false;
}
this.setState({
meta: yaml.safeLoad(data),
head: data,
});
const cnt = data + '\n---\n' + this.state.body;
this.handleSave(cnt);
}
metaMarked(src) {
const mySplitInput = this.splitInput(src);
return mySplitInput ? {
meta: yaml.safeLoad(mySplitInput[0]),
head: mySplitInput[0],
body: mySplitInput[1]
} : {
meta: null,
head: null,
body: src
};
}