SOLVED: Bricks not compatible with math equations rendered by mathjax or katex

Hi,
Following is latex that have been typed in text module of bricks builder.

x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}

It should be rendered to beautiful equation by a library like mathjax or katex and should give svg image of famous quadratic formula.

But bricks builder omits denominator and final svg looks like this:

This problem happens when a template is applied to a post or page. In all pages and posts not inheriting from templates everything is fine.

Above is pure latex and it should be used inside specific shortcodes of mathjax or katex to be rendered.

For mathjax we should use
[ some latex /] with simple mathjax plugin and for katex we should use [katex] some latex [/katex] with katex plugin.

Hello @Sharif_Payenda

Could you please contact the Bricks support to the email help@bricksbuilder.io using the same email address which you used for the license purchase? Please share with us temporary login credentials so we could investigate this issue for you.

Thank you

There is a conflict between the syntax used by the libraries like mathjax or katex and the Bricks dynamic data syntax.

Both use the {some_text} syntax. Bricks dynamic data logic will try to render the content for it but because the tag doesn’t exist, it returns an empty string, thus causing missing parts in the equations.

In Bricks 1.3.5 we’ll introduce a fix for this.

Hello @luistinygod,
As you promised to fix above mentioned bug but still after months it has not been fixed.
Should I wait a few other months?
Regards,

Hello @Sharif_Payenda

As promised we added two new hooks in Bricks 1.3.5 which you could use to bypass the issue: Changelog – Bricks

In your case, I would advise you to use the following:

add_filter( 'bricks/dynamic_data/replace_nonexistent_tags', '__return_false', 10, 1 );

Read more here: Filter: bricks/dynamic_data/replace_nonexistent_tags – Bricks Academy

Thank you
Luis

Hello @luistinygod
I was not aware of filter and thought it will work out of the box. I added filter and tested and it seems problem solved but in bricks 1.4 beta another bug has occured. Bricks 1.4 beta gives primary color automatically to fraction and radical. Please see attachment.
Capture1
It is bricks bug because I switched bricks to wordpress default theme and everything was fine.
Regards,