markdown for pages #338

Open
Johann150 wants to merge 20 commits from markdown into main
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 020a5bc5b8 - Show all commits

View File

@ -5,9 +5,9 @@ import { unique } from '@/scripts/array';
// [ http://a/#1, http://a/#2, http://b/#3 ] => [ http://a/#1, http://b/#3 ]
const removeHash = (x: string) => x.replace(/#[^#]*$/, '');
export function extractUrlFromMfm(nodes: mfm.MfmNode[], respectSilentFlag = true): string[] {
export function extractUrlFromMfm(nodes: mfm.MfmNode[]): string[] {
const urlNodes = mfm.extract(nodes, (node) => {
return (node.type === 'url') || (node.type === 'link' && (!respectSilentFlag || !node.props.silent));
return (node.type === 'url') || (node.type === 'link' && !node.props.silent);
});
const urls: string[] = unique(urlNodes.map(x => x.props.url));