Making WordPress.org

Changeset 7989


Ignore:
Timestamp:
12/19/2018 06:17:14 AM (6 years ago)
Author:
dd32
Message:

Gutenberg Docs: Add support for some new link formats as requested to allow for consistent links to work over all platforms.

See https://github.com/WordPress/gutenberg/pull/12835#issuecomment-447819488

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/inc/docs-importer.php

    r7927 r7989  
    284284        $markdown = preg_replace( '/(\[.*?\])\((\.\.\/)+docs\/(.*?)\/?(#.*)?\)/i', '$1(https://wordpress.org/gutenberg/handbook/$3/$4)', $markdown );
    285285
     286        // Handle /docs/(.+)(/README.md) path for internal links and replace it with an absolute URL
     287        $markdown = preg_replace( '@(\[.*?\])\(/docs/(.*?)/?(#.*)?\)@i', '$1(https://wordpress.org/gutenberg/handbook/$2/$3)', $markdown );
     288
     289        // Handle /packages/compomnents(/README.md)
     290        $markdown = preg_replace( '@(\[.*?\])\(/packages/components/?(#.*)?\)@i', '$1(https://wordpress.org/gutenberg/handbook/designers-developers/developers/components/$2)', $markdown );
     291
     292        // Handle /packages/components/(.+)(/README.md)
     293        $markdown = preg_replace( '@(\[.*?\])\(/packages/components/(.*?)/?(#.*)?\)@i', '$1(https://wordpress.org/gutenberg/handbook/designers-developers/developers/components/$2/$3)', $markdown );
     294
     295        // Handle /packages/(.+)(/README.md)
     296        $markdown = preg_replace( '@(\[.*?\])\(/packages/(.*?)/?(#.*)?\)@i', '$1(https://wordpress.org/gutenberg/handbook/designers-developers/developers/packages/packages-$2/$3)', $markdown );
     297
    286298        // Transform to HTML
    287299        jetpack_require_lib( 'markdown' );
Note: See TracChangeset for help on using the changeset viewer.