Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove mathjax, increase tall limit, add emoji support

uwx cc6e3267 8631feec

+43 -30
+42 -28
src/components/Post/MastodonHtmlContent.tsx
··· 11 11 import {useLingui} from '@lingui/react' 12 12 import {Trans} from '@lingui/react/macro' 13 13 14 - import {MathJaxSvg} from '#/lib/mathjax' 14 + // import {MathJaxSvg} from '#/lib/mathjax' 15 15 import {useRenderMastodonHtml} from '#/state/preferences/render-mastodon-html' 16 16 import {atoms as a} from '#/alf' 17 17 import {Button, ButtonText} from '#/components/Button' ··· 71 71 const height = event.nativeEvent.layout.height 72 72 if (contentHeight === null) { 73 73 setContentHeight(height) 74 - // Consider content "tall" if it's taller than 150px 75 - setIsTall(height > 150) 74 + // Consider content "tall" if it's taller than 200px 75 + setIsTall(height > 200) 76 76 } 77 77 } 78 78 ··· 142 142 return node.nodeValue 143 143 } 144 144 return ( 145 - <Text key={key} style={textStyle}> 145 + <Text key={key} style={textStyle} emoji> 146 146 {node.nodeValue} 147 147 </Text> 148 148 ) ··· 156 156 case 'math': 157 157 const mathText = extractMathAnnotation(element) 158 158 if (mathText) { 159 - return ( 160 - <MathJaxSvg key={key} fontCache={true}> 161 - {mathText} 162 - </MathJaxSvg> 163 - ) 159 + return null 160 + // <MathJaxSvg key={key} fontCache={true}> 161 + // {mathText} 162 + // </MathJaxSvg> 164 163 } 165 164 return null 166 165 case 'p': { ··· 169 168 ) 170 169 171 170 return ( 172 - <P key={key} style={textStyle}> 171 + <P key={key} style={textStyle} emoji> 173 172 {children} 174 173 </P> 175 174 ) ··· 188 187 paddingLeft: 12, 189 188 marginVertical: 4, 190 189 }}> 191 - <P style={textStyle}>{children}</P> 190 + <P style={textStyle} emoji> 191 + {children} 192 + </P> 192 193 </View> 193 194 ) 194 195 } ··· 205 206 borderRadius: 4, 206 207 marginVertical: 4, 207 208 }}> 208 - <P style={[textStyle, {fontFamily: 'monospace'}]}>{children}</P> 209 + <P style={[textStyle, {fontFamily: 'monospace'}]} emoji> 210 + {children} 211 + </P> 209 212 </View> 210 213 ) 211 214 } ··· 224 227 paddingHorizontal: 4, 225 228 borderRadius: 2, 226 229 }, 227 - ]}> 230 + ]} 231 + emoji> 228 232 {children} 229 233 </Text> 230 234 ) ··· 236 240 ) 237 241 238 242 return ( 239 - <Text key={key} style={[textStyle, a.font_bold]}> 243 + <Text key={key} style={[textStyle, a.font_bold]} emoji> 240 244 {children} 241 245 </Text> 242 246 ) ··· 248 252 ) 249 253 250 254 return ( 251 - <Text key={key} style={[textStyle, a.italic]}> 255 + <Text key={key} style={[textStyle, a.italic]} emoji> 252 256 {children} 253 257 </Text> 254 258 ) ··· 259 263 ) 260 264 261 265 return ( 262 - <Text key={key} style={[textStyle, a.underline]}> 266 + <Text key={key} style={[textStyle, a.underline]} emoji> 263 267 {children} 264 268 </Text> 265 269 ) ··· 271 275 ) 272 276 273 277 return ( 274 - <Text key={key} style={[textStyle, a.strike_through]}> 278 + <Text key={key} style={[textStyle, a.strike_through]} emoji> 275 279 {children} 276 280 </Text> 277 281 ) ··· 313 317 listItemIndex !== undefined ? `${listItemIndex}.` : '\u2022' 314 318 return ( 315 319 <View key={key} style={{flexDirection: 'row', marginVertical: 2}}> 316 - <Text style={[textStyle, {marginRight: 8}]}>{marker}</Text> 317 - <Text style={[textStyle, {flex: 1}]}>{children}</Text> 320 + <Text style={[textStyle, {marginRight: 8}]} emoji> 321 + {marker} 322 + </Text> 323 + <Text style={[textStyle, {flex: 1}]} emoji> 324 + {children} 325 + </Text> 318 326 </View> 319 327 ) 320 328 } ··· 324 332 ) 325 333 326 334 return ( 327 - <Text key={key} style={textStyle}> 335 + <Text key={key} style={textStyle} emoji> 328 336 {children} 329 337 </Text> 330 338 ) ··· 359 367 ) 360 368 } 361 369 } 362 - return <Text key={key}>{children}</Text> 370 + return ( 371 + <Text key={key} style={textStyle} emoji> 372 + {children} 373 + </Text> 374 + ) 363 375 } 364 376 case 'br': 365 377 return ( 366 - <Text key={key} style={textStyle}> 378 + <Text key={key} style={textStyle} emoji> 367 379 {'\n'} 368 380 </Text> 369 381 ) ··· 375 387 // Handle invisible/ellipsis classes for link formatting 376 388 if (hasClass(element, 'invisible')) { 377 389 return ( 378 - <Text key={key} style={{display: 'none'}} aria-hidden> 390 + <Text key={key} style={{display: 'none'}} aria-hidden emoji> 379 391 {children} 380 392 </Text> 381 393 ) ··· 386 398 return '\u2026' 387 399 } 388 400 return ( 389 - <Text key={key} style={textStyle}> 401 + <Text key={key} style={textStyle} emoji> 390 402 {'\u2026'} 391 403 </Text> 392 404 ) ··· 419 431 return children 420 432 } 421 433 return ( 422 - <Text key={key} style={textStyle}> 434 + <Text key={key} style={textStyle} emoji> 423 435 {children} 424 436 </Text> 425 437 ) ··· 429 441 return children 430 442 } 431 443 return ( 432 - <Text key={key} style={textStyle}> 444 + <Text key={key} style={textStyle} emoji> 433 445 {children} 434 446 </Text> 435 447 ) ··· 445 457 ) 446 458 447 459 return ( 448 - <P key={key} style={textStyle}> 449 - <Text style={[textStyle, {fontWeight: 'bold'}]}>{children}</Text> 460 + <P key={key} style={textStyle} emoji> 461 + <Text style={[textStyle, {fontWeight: 'bold'}]} emoji> 462 + {children} 463 + </Text> 450 464 </P> 451 465 ) 452 466 }
+1 -2
src/lib/mathjax/index.tsx
··· 83 83 '[tex]/verb', 84 84 ].sort() 85 85 86 - import '@mathjax/src/js/util/entities/all.js' 87 - 88 86 import { 89 87 type LiteElement, 90 88 type LiteNode, 91 89 } from '@mathjax/src/js/adaptors/lite/Element.js' 90 + import {} from '@mathjax/src/mjs/util/entities/all.js' 92 91 93 92 const adaptor = liteAdaptor() 94 93