nteract / markdown

A package for rendering Markdown within Jupyter notebooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Math in tables exhibits odd rendering behaviour

averageflamethrowerguy opened this issue · comments

Hello again!

I'd like to take a moment to thank you for maintaining this package. I'm using it as a pretty major parsing component of a quantum computing app I'm trying to get off the ground, and this is by far the best general purpose math+markdown parser I've run into thus far.

I've recently been having some issues with math blocks in HTML tables, and I'm wondering if you have any experience with or suggestions for solving these problems.

First, math delimited with '$' is being parsed as text, not as math.
Math delimited with '$$' is being parsed correctly when using hard refreshes or url navigation, but not when using view-layer navigation. When using view-layer navigation, the math remains in string form, complete with the $$ delimiter.

As far as I can tell, this issue happens exclusively with tables. Do have any ideas as to what may be causing the problem?

Here's the table, for your reference.

  <table style='font-size:16px;margin-left:auto;margin-right:auto;'>
       <tr>
              <th>Bit Value</th>
             <th style='text-align:center;'>Basis</th>
             <th style='text-align:center;'>Qubit State</th>
         </tr>
         <tr>
             <td style='text-align:center;'>0</td>
             <td>Computational</td>
             <td style='text-align:center;'>$\\left|{0}\\right\\rangle$</td>
         </tr>
         <tr>
             <td style='text-align:center;'>1</td>
             <td>Computational</td>
             <td style='text-align:center;'>$$\\left|{1}\\right\\rangle$$</td>
    </table>

I did a bit more testing -- it looks like this is not specific only to tables. <p>, <div>, <section>, <table> all display this behavior at a depth of only one HTML tag.
However, <span> seems to be treated like plaintext (and doesn't experience either issue).

@averageflamethrowerguy Just to confirm: you're trying to render LaTeX inside the HTML table within a Markdown component?

Also -- what version of the package are you using?

Yes, that's correct!
And I'm using 4.6.0