mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-17 02:49:01 +01:00
0e4a111f81
Resolve #7779
9 lines
361 B
TypeScript
9 lines
361 B
TypeScript
import { IObject } from '../type';
|
|
import { extractApHashtagObjects } from '../models/tag';
|
|
import { fromHtml } from '../../../mfm/from-html';
|
|
|
|
export function htmlToMfm(html: string, tag?: IObject | IObject[]) {
|
|
const hashtagNames = extractApHashtagObjects(tag).map(x => x.name).filter((x): x is string => x != null);
|
|
|
|
return fromHtml(html, hashtagNames);
|
|
}
|