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

Added $$ parsing #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added $$ parsing #3

wants to merge 1 commit into from

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