• Hi, while testing the plugin I tried this code

    [latex display=true]x = \begin{cases}
       a &\text{if } b \\
       c &\text{if } d
    \end{cases}[/latex]

    and this is the output

    As you can see there are <br> tags, which I think are generated by the wpautop function of wordpress. In fact by writing the equation on a single line such as

    [latex display=true]x = \begin{cases} a &\text{if } b \\ c &\text{if } d \end{cases}[/latex]

    the output is displayed correctly without br tags.
    I would like to keep wpautop activated since it is helpful in most of the cases, so I think it is better to edit the plugin.

    In the file frontend.php I noticed the following line

    $enc = htmlspecialchars( html_entity_decode( $content ) );

    and by removing the function htmlspecialchars

    $enc = html_entity_decode( $content );

    the problem seems to be solved, in fact the output is correct.
    But I am worried that by removing the that function something bad coould happen in some situations.

    So is it safe to disable it? Is there a better way to solve the problem?

    • This topic was modified 4 years, 11 months ago by giannit.
  • The topic ‘br tags in equations due to wpautop, is it safe to disable htmlspecialchars?’ is closed to new replies.