WordPress.org

bbPress Topics for Posts[resolved] Mathjax equations in the post (5 posts)

1. sangil
Member
Posted 3 years ago #

I am using "simple mathjax" plugin to display equations in LaTeX code in the post, for instance,
$\sin x$
shows sin x.

But backslashes in the post disappear when it is copied to the forum.
Then the math equations are not displayed correctly.

How can I fix this?

2. David Dean
Member
Plugin Author

Posted 3 years ago #

Hey sangil,

I see what you mean! I traced this out and it looks like the backslashes are in place until this plugin hands off the content to bbPress. They are ultimately taken off when the new topic is made, when WP runs stripslashes on the content.

I can addslashes before sending the content along, but I want to do some testing and make sure that doesn't cause any issues. In the meantime, you can put a snippet like the following in your theme's functions.php file to accomplish the same thing:

add_filter( 'bbppt_topic_content', 'addslashes' );

Let me know how this works for you!

3. sangil
Member
Posted 3 years ago #

Hello?

the contents are not copied at all.
Any suggestions?

.../wp-content/themes/twentyeleven-child\$ more functions.php
<?php
?>

4. sangil
Member
Posted 3 years ago #

Your suggestion works! (I forgot the fact that during experiment I removed the format string in the admin menu..)

I made a child theme with the above functions.php
and now it works.

5. David Dean
Member
Plugin Author

Posted 3 years ago #

Whew! You had me going there for a minute. :)

This topic has been closed to new replies.

• bbPress Topics for Posts
• Reviews