Making WordPress.org


Ignore:
Timestamp:
11/24/2014 06:16:44 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: fix make_doclink_clickable() for {@link URL TEXT} syntax usage that had been autolinked by parser

File:
1 edited

Legend:

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

    r991 r1003  
    468468            $link = $matches[1];
    469469
    470             // Fix URLs made clickable during initial parsing
     470            // Undo links made clickable during initial parsing
    471471            if ( 0 === strpos( $link, '<a ' ) ) {
    472472
    473                 if ( preg_match( '/^<a .*href=[\'\"]([^\'\"]+)[\'\"]>(.*)<\/a>$/', $link, $parts ) ) {
    474                     $link = '<a href="' . $parts[1] . '">' . esc_html( trim( $parts[2] ) ) . '</a>';
     473                if ( preg_match( '/^<a .*href=[\'\"]([^\'\"]+)[\'\"]>(.*)<\/a>(.*)$/', $link, $parts ) ) {
     474                    $link = $parts[1];
     475                    if ( $parts[3] ) {
     476                        $link .= ' ' . $parts[3];
     477                    }
    475478                }
    476479
     
    478481
    479482            // Link to an external resource.
    480             elseif ( 0 === strpos( $link, 'http' ) ) {
     483            if ( 0 === strpos( $link, 'http' ) ) {
    481484
    482485                $parts = explode( ' ', $link, 2 );
Note: See TracChangeset for help on using the changeset viewer.