@@ -46,13 +46,13 @@ import { useCapabilities } from '$hooks/useCapabilities';
4646import { profilesCacheAtom } from '$state/userRoomProfile' ;
4747import { SequenceCardStyle } from '$features/settings/styles.css' ;
4848import { useUserPresence } from '$hooks/useUserPresence' ;
49+ import { MSC1767Text } from '$types/matrix/common' ;
4950import { TimezoneEditor } from './TimezoneEditor' ;
5051import { PronounEditor } from './PronounEditor' ;
5152import { BioEditor } from './BioEditor' ;
5253import { NameColorEditor } from './NameColorEditor' ;
5354import { StatusEditor } from './StatusEditor' ;
5455import { AnimalCosmetics } from './AnimalCosmetics' ;
55- import { toPlainText } from '$components/editor' ;
5656
5757type PronounSet = {
5858 summary : string ;
@@ -582,17 +582,20 @@ function ProfileExtended({ profile, userId }: Readonly<ProfileProps>) {
582582 profile . extended ?. [ 'chat.commet.profile_bio' ] ||
583583 profile . bio
584584 }
585- onSave = { ( htmlBio ) => {
585+ onSave = { ( htmlBio , plainTextBio ) => {
586586 handleSaveField ( 'moe.sable.app.bio' , htmlBio ) ;
587587
588588 // MSC4440
589589 handleSaveField ( 'gay.fomx.biography' , {
590- body : htmlBio
591- . replaceAll ( '<br>' , '\n' )
592- . replaceAll ( '<li>' , '\n- ' )
593- . replaceAll ( / < [ ^ > ] * > / g, '' ) ,
594- format : 'org.matrix.custom.html' ,
595- formatted_body : htmlBio ,
590+ 'm.text' : [
591+ {
592+ body : htmlBio ,
593+ mimetype : 'text/html' ,
594+ } satisfies MSC1767Text ,
595+ {
596+ body : plainTextBio ,
597+ } satisfies MSC1767Text ,
598+ ] ,
596599 } satisfies MSC4440Bio ) ;
597600
598601 const cleanedHtml = htmlBio . replaceAll ( '<br/></blockquote>' , '</blockquote>' ) ;
0 commit comments