APメンションはaudienceじゃなくてtagを参照するなど (#6128)
* APメンションはaudienceじゃなくてtagを参照するなど * AP/tag/Mentionではurlじゃなくてuriを提示する * createPersonでaliasが入力された場合に対応 * AP HTMLパースでMention/Hashtag判定にtagを使うように * fix * indent * use hashtag name * fix * URLエンコード不要だったら<>を使わないの条件が消えたたのを修正
This commit is contained in:
parent
8bb311df51
commit
99fc77b678
8 changed files with 128 additions and 64 deletions
9
src/remote/activitypub/misc/html-to-mfm.ts
Normal file
9
src/remote/activitypub/misc/html-to-mfm.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { IObject } from '../type';
|
||||
import { extractApHashtagObjects } from '../models/tag';
|
||||
import { fromHtml } from '../../../mfm/fromHtml';
|
||||
|
||||
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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue