Making WordPress.org

Changeset 11254


Ignore:
Timestamp:
09/24/2021 01:45:53 AM (3 years ago)
Author:
dd32
Message:

Trac: GitHub: Convert images to Trac embedded images.

See example on https://meta.trac.wordpress.org/ticket/5916

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/functions.php

    r11245 r11254  
    345345    // Convert Images (Must happen prior to Links, as the only difference is a preceeding !)
    346346    $desc = preg_replace( '#!\[(.+?)\]\(https?://(.+?)\)#', '[[Image(https://i0.wp.com/$2)]]', $desc );
     347    // Convert Images embedded as `<img>`.
     348    $desc = preg_replace( '#<img[^>]+src=(["\'])(https?://(.+?)\\1[^>]*>#', '[[Image(https://i0.wp.com/$2)]]', $desc );
    347349
    348350    // Convert Links.
Note: See TracChangeset for help on using the changeset viewer.