インラインコードを実装

This commit is contained in:
syuilo 2017-02-11 23:41:57 +09:00
parent 8107a6e539
commit fa70c40b33
6 changed files with 38 additions and 7 deletions

View file

@ -0,0 +1,14 @@
/**
* Code (inline)
*/
module.exports = text => {
const match = text.match(/^`(.+?)`/);
if (!match) return null;
const code = match[0];
return {
type: 'inline-code',
content: code,
code: code.substr(1, code.length - 2).trim()
};
};