diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-03-31 20:50:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-31 20:50:40 +0900 |
| commit | eafb0f61ef6465697a0fbd9b931fc306417cd2a1 (patch) | |
| tree | 7d6c502c1e2c61eb3327f678f766f23bda10c1e7 /src/common/text/parse/elements/inline-code.ts | |
| parent | デフォルトでドライブ容量は128MiBにした (diff) | |
| parent | Implement remote status retrieval (diff) | |
| download | sharkey-eafb0f61ef6465697a0fbd9b931fc306417cd2a1.tar.gz sharkey-eafb0f61ef6465697a0fbd9b931fc306417cd2a1.tar.bz2 sharkey-eafb0f61ef6465697a0fbd9b931fc306417cd2a1.zip | |
Merge pull request #1341 from akihikodaki/github
Implement remote status retrieval
Diffstat (limited to 'src/common/text/parse/elements/inline-code.ts')
| -rw-r--r-- | src/common/text/parse/elements/inline-code.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/text/parse/elements/inline-code.ts b/src/common/text/parse/elements/inline-code.ts new file mode 100644 index 0000000000..9f9ef51a2b --- /dev/null +++ b/src/common/text/parse/elements/inline-code.ts @@ -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()) + }; +}; |