リモートユーザーのHTMLで表現されたプロフィールをMFMに変換するように
This commit is contained in:
19
src/mfm/parse/elements/search.ts
Normal file
19
src/mfm/parse/elements/search.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Search
|
||||
*/
|
||||
|
||||
export type TextElementSearch = {
|
||||
type: 'search'
|
||||
content: string
|
||||
query: string
|
||||
};
|
||||
|
||||
export default function(text: string) {
|
||||
const match = text.match(/^(.+?) 検索(\n|$)/);
|
||||
if (!match) return null;
|
||||
return {
|
||||
type: 'search',
|
||||
content: match[0],
|
||||
query: match[1]
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user