Changeset 7993 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/inc/docs-importer.php
- Timestamp:
- 12/20/2018 12:54:55 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/inc/docs-importer.php
r7989 r7993 279 279 280 280 // Remove the .md extension from relative links and treat 'readme.md' as an index 281 $markdown = preg_replace( ' /(\[.*?\]\((\.\.\/)+.*?)((\/readme)?\.md)?(#.*)?\)/i', '$1$5)', $markdown );281 $markdown = preg_replace( '@(\[.*?\]\(((\.\./)+docs/|/docs/|/packages/).*?)(((?<=/)readme)?\.md)?(#.*)?\)@i', '$1$6)', $markdown ); 282 282 283 283 // Remove the (../)*docs/ path from relative links, and replace it with an absolute URL 284 $markdown = preg_replace( ' /(\[.*?\])\((\.\.\/)+docs\/(.*?)\/?(#.*)?\)/i', '$1(https://wordpress.org/gutenberg/handbook/$3/$4)', $markdown );284 $markdown = preg_replace( '@(\[.*?\])\((\.\./)+docs/(.*?)/?(#.*)?\)@i', '$1(https://wordpress.org/gutenberg/handbook/$3/$4)', $markdown ); 285 285 286 286 // Handle /docs/(.+)(/README.md) path for internal links and replace it with an absolute URL
Note: See TracChangeset
for help on using the changeset viewer.