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

Projects
None yet
3 participants
@jeherve
Copy link
Member

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' );
Markdown: filter to define a custom pattern that won't be processed
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
Markdown: allow for an array of patterns to be ignored.
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 pull request Feb 18, 2016

Merge pull request #3415 from Automattic/add/filter-markdown-preserve
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

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@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