Abolish common and misc directories

This commit is contained in:
Akihiko Odaki
2018-04-02 12:58:53 +09:00
parent a0f8b4e940
commit 5b9f3701f5
111 changed files with 133 additions and 133 deletions

View File

@@ -0,0 +1,17 @@
/**
* Code (block)
*/
import genHtml from '../core/syntax-highlighter';
module.exports = text => {
const match = text.match(/^```([\s\S]+?)```/);
if (!match) return null;
const code = match[0];
return {
type: 'code',
content: code,
code: code.substr(3, code.length - 6).trim(),
html: genHtml(code.substr(3, code.length - 6).trim())
};
};