インラインコードを実装
This commit is contained in:
parent
8107a6e539
commit
fa70c40b33
6 changed files with 38 additions and 7 deletions
14
src/common/text/elements/inline-code.js
Normal file
14
src/common/text/elements/inline-code.js
Normal 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()
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue