Skip to content

Added $$ parsing#3

Open
timdecode wants to merge 1 commit into
as-com:masterfrom
timdecode:master
Open

Added $$ parsing#3
timdecode wants to merge 1 commit into
as-com:masterfrom
timdecode:master

Conversation

@timdecode
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

delip commented Mar 30, 2015

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

@as-com
Copy link
Copy Markdown
Owner

as-com commented Mar 30, 2015

@delip WordPress automatically disables wpautop inside shortcodes.

Comment thread scripts/frontend.php

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

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