Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error activating Mathjax plugin in WordPress #15

Open
reakoh opened this issue Nov 2, 2016 · 3 comments
Open

error activating Mathjax plugin in WordPress #15

reakoh opened this issue Nov 2, 2016 · 3 comments

Comments

@reakoh
Copy link

reakoh commented Nov 2, 2016

Hello,

I'm new to using Mathjax and I'd like to try it on a wordpress.org webpage.
I downloaded the plugin but it gives me an error when I try to activate it:

Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_FUNCTION in /.../wp-content/plugins/mathjax-latex/mathjax-latex.php on line 235

Could somebody help with this please?

Kind Regards

@reakoh reakoh closed this as completed Nov 6, 2016
@phillord
Copy link
Owner

phillord commented Nov 7, 2016

Sorry for slow reply. Did you fix it?

@reakoh
Copy link
Author

reakoh commented Nov 7, 2016

Yes thank you by replacing a couple of lines of code in the mathjax php file.

public static function filter_br_tags_on_math( $content ) {
    return preg_replace_callback(
        '/(<math.*>.*<\/math>)/isU',
        function ( $matches ) {
            return str_replace( array( '<br/>', '<br />', '<br>' ) , '' , $matches[0] );
        },
        $content
    );
}

@paulschreiber paulschreiber reopened this Nov 13, 2016
@paulschreiber
Copy link
Collaborator

@reakoh What version of PHP are you using? What change did you make?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants