mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-13 07:43:09 +02:00
19 lines
458 B
TypeScript
19 lines
458 B
TypeScript
import { mfmLanguage } from './language';
|
|
import { MfmForest } from './types';
|
|
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));
|
|
}
|