mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-29 18:16:44 -06:00
38656103c0
* Add angle bracket covered url syntax to mfm * Fix path * Fix match * Fix index
19 lines
460 B
TypeScript
19 lines
460 B
TypeScript
import { mfmLanguage } from './language';
|
|
import { MfmForest } from './prelude';
|
|
import { normalize } from './normalize';
|
|
|
|
export function parse(source: string): MfmForest {
|
|
if (source == null || source == '') {
|
|
return null;
|
|
}
|
|
|
|
return normalize(mfmLanguage.root.tryParse(source));
|
|
}
|
|
|
|
export function parsePlain(source: string): MfmForest {
|
|
if (source == null || source == '') {
|
|
return null;
|
|
}
|
|
|
|
return normalize(mfmLanguage.plain.tryParse(source));
|
|
}
|