Links in last row of aligned, array, matrix, frac, ... are not active
See original GitHub issueDescribe the bug:
Links produced by \url{...} are not active in the last row of an array or matrix, nor in the denominator of a fraction.
The following examples show this on the KaTeX demo page (when the trust option is turned on):
\begin{array}{c}
\url{https://katex.org/} \text{ is active} \\
\url{https://katex.org/} \text{ is active} \\
\url{https://katex.org/} \text{ is inactive}
\end{array}
\frac
{\url{https://katex.org/} \text{ is active}}
{\url{https://katex.org/} \text{ is inactive}}
To Reproduce: Steps to reproduce the behavior:
- Go to https://katex.org
- Open the KaTeX Options pane and turn on the trust option (output html or htmlAndMathml)
- Enter either of the above examples
- The link in the bottom line does not react to hovering or clicking
Expected behavior: Links should be active wherever they are displayed
Screenshots: The links in the bottom lines look normal, but hovering or clicking on them has no effect; the links in the upper lines are active and react normally.
Environment (please complete the following information):
- KaTeX Version: 0.12.0
- Device: Desktop
- OS: macOS
- Browser: Safari
- Version: 14.0.2
Additional context:
Variations of the array example:
- 1 row: link is active
- 2 rows: link in last row is inactive
- 3 rows: link in last row is inactive
- 4 rows: links in last 2 rows are inactive (!)
- 5 rows: links in last 2 rows are inactive
matrix has the same error. Presumably the implementations of \frac, {array} and {matrix} are closely related.
In the html generated by the \frac example, the following node appears to be covering the bottom line:
<span class="vlist" style="height: 0.90822em;"><span class=""></span></span>
When that node is deleted (manually in the browser) the link in the bottom line can be clicked.
I ran into this bug when using \href to link symbols in fractions to their definitions. For{array}, the following workaround makes both links active:
\begin{array}{c}
\url{https://katex.org/} \text{ is active} \\
\url{https://katex.org/} \text{ is active} \\{}
\end{array}
I don’t see a workaround for \frac (other than using an array with an \hline).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (1 by maintainers)

Top Related StackOverflow Question
The following CSS makes all the links clickable in my examples:
Does that work in general, or are different selectors needed for other patterns of math display?
This still doesn’t work in 0.16.0. I’m using the workaround given above, but I’m unsure if it will cause any other issues.