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

Markdown: filter to define a custom pattern that won't be processed #3415

Merged
merged 2 commits into from Feb 18, 2016

Conversation

@jeherve
Copy link
Member

@jeherve jeherve commented Feb 16, 2016

Plugin authors can use this new jetpack_markdown_preserve_pattern to define custom patterns that will be ignored by Markdown.

See the example here: https://wordpress.org/support/topic/photon-prevents-svg-images-to-be-shown-properly?replies=4&view=all#post-8034089

The plugin author could then make sure their LaTeX code is not processed by Jetpack Markdown like so:

function jeherve_custom_md_pattern( $patterns ) {
    $patterns[] = '/(!*\\\\\[.*?\\\\\])/s';

    return $patterns;
}
add_filter( 'jetpack_markdown_preserve_pattern', 'jeherve_custom_md_pattern' );
Plugin authors can use this new `jetpack_markdown_preserve_pattern` to define a custom pattern that will be ignored by Markdown.

@see https://wordpress.org/support/topic/photon-prevents-svg-images-to-be-shown-properly?replies=4&view=all#post-8034089
This makes the filter more flexible; it can now be used to pass an array of patterns, in multiple plugins.
dereksmart added a commit that referenced this issue Feb 18, 2016
Markdown: filter to define a custom pattern that won't be processed
@dereksmart dereksmart merged commit 9089bc2 into master Feb 18, 2016
2 checks passed
@dereksmart dereksmart deleted the add/filter-markdown-preserve branch Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants