Implement new MFM syntax
This commit is contained in:
20
src/mfm/parse/elements/big.ts
Normal file
20
src/mfm/parse/elements/big.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* 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;
|
||||
}
|
Reference in New Issue
Block a user