@@ -49,10 +49,13 @@ export function SearchText ({ text }) {
49
49
50
50
// this is one of the slowest components to render
51
51
export default memo ( function Text ( { rel = UNKNOWN_LINK_REL , imgproxyUrls, children, tab, itemId, outlawed, topLevel } ) {
52
+ // would the text overflow on the current screen size?
52
53
const [ overflowing , setOverflowing ] = useState ( false )
53
- const router = useRouter ( )
54
+ // should we show the full text?
54
55
const [ show , setShow ] = useState ( false )
55
56
const containerRef = useRef ( null )
57
+
58
+ const router = useRouter ( )
56
59
const [ mathJaxPlugin , setMathJaxPlugin ] = useState ( null )
57
60
58
61
// we only need mathjax if there's math content between $$ tags
@@ -69,9 +72,9 @@ export default memo(function Text ({ rel = UNKNOWN_LINK_REL, imgproxyUrls, child
69
72
70
73
// if we are navigating to a hash, show the full text
71
74
useEffect ( ( ) => {
72
- setShow ( router . asPath . includes ( '#' ) && ! router . asPath . includes ( '#itemfn-' ) )
75
+ setShow ( router . asPath . includes ( '#' ) )
73
76
const handleRouteChange = ( url , { shallow } ) => {
74
- setShow ( url . includes ( '#' ) && ! url . includes ( '#itemfn-' ) )
77
+ setShow ( url . includes ( '#' ) )
75
78
}
76
79
77
80
router . events . on ( 'hashChangeStart' , handleRouteChange )
0 commit comments