@@ -14,10 +14,12 @@ import axios from 'axios';
1414import { stringify } from 'components/PostCreate/formatter' ;
1515import { PostDetailContainer } from 'components/PostDetail/PostDetail.container' ;
1616import { COOKIE_INSTANCE_URL } from 'components/SelectServer' ;
17+ import parse from 'html-react-parser' ;
1718import { TopNavbarComponent } from 'src/components/atoms/TopNavbar' ;
1819import { TippingSuccess } from 'src/components/common/Tipping/render/Tipping.success' ;
1920import { DefaultLayout } from 'src/components/template/Default/DefaultLayout' ;
2021import { generateAnonymousUser } from 'src/helpers/auth' ;
22+ import { htmlToJson , isJson } from 'src/helpers/string' ;
2123import { Post } from 'src/interfaces/post' ;
2224import { User } from 'src/interfaces/user' ;
2325import { initialize } from 'src/lib/api/base' ;
@@ -179,7 +181,7 @@ export const getServerSideProps = wrapper.getServerSideProps(store => async cont
179181
180182 if ( anonymous ) {
181183 const username = generateAnonymousUser ( ) ;
182- const queryInstanceURL = query . rpc ;
184+ const queryInstanceURL = query . instance ;
183185
184186 apiURL = queryInstanceURL ?? cookiesInstanceURL ?? defaultInstanceURL ;
185187 res . setHeader ( 'set-cookie' , [ `${ COOKIE_INSTANCE_URL } =${ apiURL } ` ] ) ;
@@ -219,9 +221,16 @@ export const getServerSideProps = wrapper.getServerSideProps(store => async cont
219221
220222 if ( post ?. platform === 'myriad' ) {
221223 const { text, image : imageData } = stringify ( post ) ;
224+ const isHtmlContent = ! isJson ( text ) ;
225+ if ( isHtmlContent ) {
226+ description = htmlToJson ( parse ( post . text ) ) . text ;
227+ image = htmlToJson ( parse ( post . text ) ) . img [ 0 ] ?? '' ;
228+ } else {
229+ description = text ;
230+ image = imageData ;
231+ }
232+
222233 title = post ?. title ?? `${ post . user . name } on ${ publicRuntimeConfig . appName } ` ;
223- description = text ;
224- image = imageData ;
225234 }
226235
227236 if ( post ?. platform !== 'myriad' ) {
0 commit comments