MathJax Default Flags Missing Inline Delimiters

Created on 4 June 2024, 22 days ago
Updated 5 June 2024, 21 days ago

Problem/Motivation

The inline examples don't work unless the block examples are included.

<p>
    <mark>If the MathJax library is installed properly, you should see the square root of x here: $ \sqrt{x} $ and the square root of y here: \(\sqrt{y}\)</mark>
</p>
<p>
    $$\text{The quadratic formula should appear here: } x = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a}$$
</p>
<p>
    \[\text{The cubic equation should appear here: } a x^3\; +\; b x^2\; +\; c x\; +\; d\; =\; 0\]
</p> 

Steps to reproduce

  1. Install and enable MathJax plugin.
  2. Apply this patch for 3016329 β†’ ,
  3. Verify that the MathJax plugin (/admin/config/content/mathjax) is configured properly.
    My settings included:
    • "Use MathJax Content Delivery Network (CDN)"
    • "MathJax CDN URL" set to
    • "Configuration Type" with selected
    • "Enable on admin pages."
  4. Add MathJax to a text format in "Text formats and editors" (/admin/config/content/formats).
  5. Create a piece of content containing a field that utilizes the text format that you enabled MathJax for. It should have an inline formula. For example
    <p>
        <mark>If the MathJax library is installed properly, you should see the square root of x here: $ \sqrt{x} $ and the square root of y here: \(\sqrt{y}\)</mark>
    </p>
    
  6. Verify that the inline formulas are properly rendered.

Proposed resolution

In /src/Plugin/Filter/MathjaxFilter.php, the default inline math should be [['$', '$'], ['\(', '\)']] as opposed to an empty array.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States perrygeorget

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024