yatta
This commit is contained in:
parent
80e5645a84
commit
e66d7babc5
56 changed files with 115 additions and 112 deletions
|
|
@ -4,7 +4,7 @@ import config from '../config';
|
|||
import { INote } from '../models/note';
|
||||
import { TextElement } from './parse';
|
||||
|
||||
const handlers: {[key: string]: (window: any, token: any, mentionedRemoteUsers: INote["mentionedRemoteUsers"]) => void} = {
|
||||
const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers: INote['mentionedRemoteUsers']) => void } = {
|
||||
bold({ document }, { bold }) {
|
||||
const b = document.createElement('b');
|
||||
b.textContent = bold;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementBold = {
|
||||
type: "bold"
|
||||
type: 'bold'
|
||||
content: string
|
||||
bold: string
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
import genHtml from '../core/syntax-highlighter';
|
||||
|
||||
export type TextElementCode = {
|
||||
type: "code"
|
||||
type: 'code'
|
||||
content: string
|
||||
code: string
|
||||
html: string
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementEmoji = {
|
||||
type: "emoji"
|
||||
type: 'emoji'
|
||||
content: string
|
||||
emoji: string
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementHashtag = {
|
||||
type: "hashtag"
|
||||
type: 'hashtag'
|
||||
content: string
|
||||
hashtag: string
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
import genHtml from '../core/syntax-highlighter';
|
||||
|
||||
export type TextElementInlineCode = {
|
||||
type: "inline-code"
|
||||
type: 'inline-code'
|
||||
content: string
|
||||
code: string
|
||||
html: string
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementLink = {
|
||||
type: "link"
|
||||
type: 'link'
|
||||
content: string
|
||||
title: string
|
||||
url: string
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
import parseAcct from '../../../acct/parse';
|
||||
|
||||
export type TextElementMention = {
|
||||
type: "mention"
|
||||
type: 'mention'
|
||||
content: string
|
||||
username: string
|
||||
host: string
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementQuote = {
|
||||
type: "quote"
|
||||
type: 'quote'
|
||||
content: string
|
||||
quote: string
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementSearch = {
|
||||
type: "search"
|
||||
type: 'search'
|
||||
content: string
|
||||
query: string
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementTitle = {
|
||||
type: "title"
|
||||
type: 'title'
|
||||
content: string
|
||||
title: string
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
export type TextElementUrl = {
|
||||
type: "url"
|
||||
type: 'url'
|
||||
content: string
|
||||
url: string
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@
|
|||
* Misskey Text Analyzer
|
||||
*/
|
||||
|
||||
import { TextElementBold } from "./elements/bold";
|
||||
import { TextElementCode } from "./elements/code";
|
||||
import { TextElementEmoji } from "./elements/emoji";
|
||||
import { TextElementHashtag } from "./elements/hashtag";
|
||||
import { TextElementInlineCode } from "./elements/inline-code";
|
||||
import { TextElementLink } from "./elements/link";
|
||||
import { TextElementMention } from "./elements/mention";
|
||||
import { TextElementQuote } from "./elements/quote";
|
||||
import { TextElementSearch } from "./elements/search";
|
||||
import { TextElementTitle } from "./elements/title";
|
||||
import { TextElementUrl } from "./elements/url";
|
||||
import { TextElementBold } from './elements/bold';
|
||||
import { TextElementCode } from './elements/code';
|
||||
import { TextElementEmoji } from './elements/emoji';
|
||||
import { TextElementHashtag } from './elements/hashtag';
|
||||
import { TextElementInlineCode } from './elements/inline-code';
|
||||
import { TextElementLink } from './elements/link';
|
||||
import { TextElementMention } from './elements/mention';
|
||||
import { TextElementQuote } from './elements/quote';
|
||||
import { TextElementSearch } from './elements/search';
|
||||
import { TextElementTitle } from './elements/title';
|
||||
import { TextElementUrl } from './elements/url';
|
||||
|
||||
const elements = [
|
||||
require('./elements/bold'),
|
||||
|
|
@ -28,7 +28,7 @@ const elements = [
|
|||
require('./elements/search')
|
||||
].map(element => element.default as TextElementProcessor);
|
||||
|
||||
export type TextElement = {type: "text", content: string}
|
||||
export type TextElement = { type: 'text', content: string }
|
||||
| TextElementBold
|
||||
| TextElementCode
|
||||
| TextElementEmoji
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue