mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 17:33:08 +02:00
987168b863
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
19 lines
488 B
TypeScript
19 lines
488 B
TypeScript
import { mfmLanguage } from './language';
|
|
import { MfmForest } from './prelude';
|
|
import { normalize } from './normalize';
|
|
|
|
export function parse(source: string | null): MfmForest | null {
|
|
if (source == null || source == '') {
|
|
return null;
|
|
}
|
|
|
|
return normalize(mfmLanguage.root.tryParse(source));
|
|
}
|
|
|
|
export function parsePlain(source: string | null): MfmForest | null {
|
|
if (source == null || source == '') {
|
|
return null;
|
|
}
|
|
|
|
return normalize(mfmLanguage.plain.tryParse(source));
|
|
}
|