Changeset 7844
- Timestamp:
- 11/14/2018 12:30:35 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/formatting.php
r7769 r7844 40 40 add_filter( 'devhub-format-description', array( __CLASS__, 'fix_param_hash_formatting' ), 9 ); 41 41 add_filter( 'devhub-format-description', array( __CLASS__, 'fix_param_description_parsedown_bug' ) ); 42 add_filter( 'devhub-format-description', array( __CLASS__, 'fix_param_description_html_as_code' ) ); 42 43 43 44 add_filter( 'devhub-function-return-type', array( __CLASS__, 'autolink_references' ) ); … … 569 570 } 570 571 572 /** 573 * Wraps single-quoted HTML within 'code' tags. 574 * 575 * The HTML should have been denoted with backticks in the original source, in 576 * which case it would have been parsed properly, but committers aren't 577 * always sticklers for documentation formatting. 578 * 579 * @access public 580 * 581 * @param string $text Text. 582 * @return string 583 */ 584 public static function fix_param_description_html_as_code( $text ) { 585 if ( false !== strpos( $text, "'<" ) ) { 586 $text = preg_replace( '/\'(<[^\']+>)\'/', '<code>$1</code>', $text ); 587 } 588 589 return $text; 590 } 591 571 592 } // DevHub_Formatting 572 593
Note: See TracChangeset
for help on using the changeset viewer.