Skip to content

Conversation

@timdecode
Copy link

Added $$ parsing so that one can write things like $$y = sin(x)$$ instead of [latex]y = sin(x)[/latex].

Also, I changed the cdn version for katex to what you had on your plugin page.

Nice work, I'm very happy to have Katex working in WP.

@as-com
Copy link
Owner

as-com commented Feb 4, 2015

Hi,

Thanks for the pull request! There seems to be one issue here, though. wpautop might mess up the LaTeX in the $$...$$. I think it is necessary to prevent that from happening or at least reverse it.

@delip
Copy link

delip commented Mar 30, 2015

Any idea how WP-Latex is getting around this problem?

@as-com
Copy link
Owner

as-com commented Mar 30, 2015

@delip WordPress automatically disables wpautop inside shortcodes.


function content_parser($content)
{
$content = preg_replace_callback('/(!*\$\$(.*?)\$\$)/s','do_doubledollars',$content);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion replace .* with [^\n]+

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

Successfully merging this pull request may close these issues.

4 participants