Making WordPress.org

Changeset 5447


Ignore:
Timestamp:
04/30/2017 06:51:22 PM (9 years ago)
Author:
ocean90
Message:

Plugin Directory: Include <dt> tags when parsing sections for headers.

Ensures that FAQ headers can be translated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/i18n/class-readme-import.php

    r5444 r5447  
    8989                foreach ( $readme->sections as $section_key => $section_text ) {
    9090                        if ( 'changelog' !== $section_key ) { // No need to scan non-translatable version headers in changelog.
    91                                 if ( preg_match_all( '|<h[3-4]+[^>]*>(.+)</h[3-4]+>|', $section_text, $matches ) ) {
    92                                         if ( ! empty( $matches[1] ) ) {
    93                                                 foreach ( $matches[1] as $text ) {
     91                                if ( preg_match_all( '~<(h[3-4]|dt)[^>]*>(.+)</\1>~', $section_text, $matches ) ) {
     92                                        if ( ! empty( $matches[2] ) ) {
     93                                                foreach ( $matches[2] as $text ) {
    9494                                                        $section_strings = $this->handle_translator_comment( $section_strings, $text, "{$section_key} header" );
    9595                                                }
Note: See TracChangeset for help on using the changeset viewer.