summaryrefslogtreecommitdiff
path: root/src/text/parse/elements/inline-code.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-06-18 14:43:56 +0900
committerGitHub <noreply@github.com>2018-06-18 14:43:56 +0900
commit5d3943ffa8cb4090c5c111397e266d255cc2212b (patch)
tree46f692fb21005bdc89499ea012c2436e8a2e90c0 /src/text/parse/elements/inline-code.ts
parentNew translations ja.yml (Spanish) (diff)
parentyatta (diff)
downloadmisskey-5d3943ffa8cb4090c5c111397e266d255cc2212b.tar.gz
misskey-5d3943ffa8cb4090c5c111397e266d255cc2212b.tar.bz2
misskey-5d3943ffa8cb4090c5c111397e266d255cc2212b.zip
Merge branch 'master' into l10n_master
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..1dd5affa51 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;
+}