Sharkey/src/mfm/parse/elements/big.ts

21 lines
316 B
TypeScript
Raw Normal View History

2018-08-03 23:27:37 +09:00
/**
2018-08-05 12:33:55 +09:00
* Big
2018-08-03 23:27:37 +09:00
*/
export type TextElementBig = {
2018-11-03 22:38:12 +09:00
type: 'big';
content: string;
big: string;
2018-08-03 23:27:37 +09:00
};
export default function(text: string) {
const match = text.match(/^\*\*\*(.+?)\*\*\*/);
if (!match) return null;
const big = match[0];
return {
type: 'big',
content: big,
big: match[1]
} as TextElementBig;
}