Abolish common and misc directories
This commit is contained in:
parent
a0f8b4e940
commit
5b9f3701f5
111 changed files with 133 additions and 133 deletions
17
src/text/parse/elements/inline-code.ts
Normal file
17
src/text/parse/elements/inline-code.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Code (inline)
|
||||
*/
|
||||
|
||||
import genHtml from '../core/syntax-highlighter';
|
||||
|
||||
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(),
|
||||
html: genHtml(code.substr(1, code.length - 2).trim())
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue