Changeset 14814
- Timestamp:
- 04/14/2026 08:37:26 AM (4 weeks ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 1 added
- 2 edited
-
class-plugin-i18n.php (modified) (1 diff)
-
cli/i18n/class-readme-import.php (modified) (3 diffs)
-
tests/Plugin_I18n_Test.php (added)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php
r12176 r14814 394 394 $content = $marker; 395 395 } else { 396 $original = preg_quote( $original, '/' );397 398 if ( false === strpos( $content, '<' ) ) {396 $original = preg_quote( trim( $original ), '/' ); 397 398 if ( ! str_contains( $content, '<' ) ) { 399 399 $content = preg_replace( "/\b{$original}\b/", $marker, $content ); 400 400 } else { 401 $content = preg_replace( "/(<([a-z0-9]*)\b[^>]*>){$original}(<\/\\2>)/m", "\${1}{$marker}\${3}", $content ); 401 $content = preg_replace( "/(<([a-z0-9]*)\b[^>]*>)\s*{$original}\s*(<\/\\2>)/m", "\${1}{$marker}\${3}", $content ); 402 403 // Nested lists: match <li>STRING<ul> or <li>STRING<ol>. 404 if ( ! str_contains( $content, $marker ) ) { 405 $content = preg_replace( "/(<li\b[^>]*>)\s*{$original}\s*(<[uo]l\b[^>]*>)/m", "\${1}{$marker}\${2}", $content ); 406 } 402 407 } 403 408 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/i18n/class-readme-import.php
r14778 r14814 89 89 foreach ( $readme->sections as $section_key => $section_text ) { 90 90 91 if ( preg_match_all( '~<(h[ 3-4]|dt)[^>]*>([^<].+)</\1>~', $section_text, $matches ) ) {91 if ( preg_match_all( '~<(h[1-6]|dt)[^>]*>([^<].+)</\1>~', $section_text, $matches ) ) { 92 92 if ( ! empty( $matches[2] ) ) { 93 93 foreach ( $matches[2] as $text ) { … … 97 97 } 98 98 99 $section_strings = $this->handle_translator_comment( $section_strings, $text, "{$section_key} header" );99 $section_strings = $this->handle_translator_comment( $section_strings, trim( $text ), "{$section_key} header" ); 100 100 if ( 'changelog' === $section_key ) { 101 101 $str_priorities[ $text ] = -1; … … 108 108 if ( ! empty( $matches[1] ) ) { 109 109 foreach ( $matches[1] as $text ) { 110 $section_strings = $this->handle_translator_comment( $section_strings, $text, "{$section_key} list item" );110 $section_strings = $this->handle_translator_comment( $section_strings, trim( $text ), "{$section_key} list item" ); 111 111 if ( 'changelog' === $section_key ) { 112 112 $str_priorities[ $text ] = -1;
Note: See TracChangeset
for help on using the changeset viewer.