summaryrefslogtreecommitdiff
path: root/src/text/parse/elements/inline-code.ts
diff options
context:
space:
mode:
authorrinsuki <428rinsuki+git@gmail.com>2018-06-17 19:55:39 +0900
committerrinsuki <428rinsuki+git@gmail.com>2018-06-17 19:55:39 +0900
commit8c40917cc2762a498cd2d35a4f4f69b01de3d672 (patch)
treeb2e32a07e1fb85964558428068f745a1c299118f /src/text/parse/elements/inline-code.ts
parentbuild:ts success (diff)
downloadsharkey-8c40917cc2762a498cd2d35a4f4f69b01de3d672.tar.gz
sharkey-8c40917cc2762a498cd2d35a4f4f69b01de3d672.tar.bz2
sharkey-8c40917cc2762a498cd2d35a4f4f69b01de3d672.zip
[noImplicitAny: true] src/text
Diffstat (limited to 'src/text/parse/elements/inline-code.ts')
-rw-r--r--src/text/parse/elements/inline-code.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/text/parse/elements/inline-code.ts b/src/text/parse/elements/inline-code.ts
index 9f9ef51a2b..bcb0bca0ad 100644
--- a/src/text/parse/elements/inline-code.ts
+++ b/src/text/parse/elements/inline-code.ts
@@ -4,7 +4,14 @@
import genHtml from '../core/syntax-highlighter';
-module.exports = text => {
+export type TextElementInlineCode = {
+ type: "inline-code"
+ content: string
+ code: string
+ html: string
+};
+
+export default function(text: string) {
const match = text.match(/^`(.+?)`/);
if (!match) return null;
const code = match[0];
@@ -13,5 +20,5 @@ module.exports = text => {
content: code,
code: code.substr(1, code.length - 2).trim(),
html: genHtml(code.substr(1, code.length - 2).trim())
- };
-};
+ } as TextElementInlineCode;
+}