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

  1. sangil
    Posted 4 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
    Plugin Author

    Posted 4 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
    Posted 4 years ago #


    Unfortunately, after adding "add_filter" to the functions.php into the child theme,
    the contents are not copied at all.
    Any suggestions?

    .../wp-content/themes/twentyeleven-child$ more functions.php
    add_filter( 'bbppt_topic_content', 'addslashes' );

  4. sangil
    Posted 4 years ago #

    Oops... Please ignore my previous reply.
    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
    Plugin Author

    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • bbPress Topics for Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic