WordPress.org

Making WordPress.org

Changeset 1914


Ignore:
Timestamp:
09/27/2015 05:26:14 PM (5 years ago)
Author:
drewapicture
Message:

DevHub: Adjust the conditions in fix_unintended_markdown() to skip content where paragraph tags are present.

We can skip content containing paragraph tags because we know they won't be used within parameters or parameter descriptions, nor will they be used in outputting parameters, which are handled as definition term elements.

The original intended use-case of the function is still satisfied.

Fixes #1250.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/formatting.php

    r1138 r1914  
    179179    public static function fix_unintended_markdown( $content, $post_type = null ) {
    180180        // Only apply to parsed content that have the em tag.
    181         if ( DevHub\is_parsed_post_type( $post_type ) && false !== strpos( $content, '<em>' ) ) {
     181        if ( DevHub\is_parsed_post_type( $post_type )
     182            && false !== strpos( $content, '<em>' )
     183            && false === strpos( $content, '<p>' )
     184        ) {
    182185            $content = preg_replace_callback(
    183186                '/([^\s])<em>(.+)<\/em>/',
Note: See TracChangeset for help on using the changeset viewer.