yumechi-no-kuni/src/mfm/parse/elements/big.ts

21 lines
314 B
TypeScript
Raw Normal View History

2018-08-03 09:27:37 -05:00
/**
* Bold
*/
export type TextElementBig = {
type: 'big'
content: string
big: string
};
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;
}