Implement new MFM syntax
This commit is contained in:
parent
42fbc7ab66
commit
d456e5e45c
5 changed files with 49 additions and 1 deletions
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue