Changeset 10573
- Timestamp:
- 01/13/2021 01:24:14 AM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
r10566 r10573 428 428 $this->sections['faq'] .= "\n<dl>\n"; 429 429 foreach ( $this->faq as $question => $answer ) { 430 $question_slug = sanitize_title_with_dashes( $question);430 $question_slug = rawurlencode( trim( strtolower( $question ) ) ); 431 431 $this->sections['faq'] .= "<dt id='{$question_slug}'><h3>{$question}</h3></dt>\n<dd>{$answer}</dd>\n"; 432 432 } … … 524 524 'ol' => array(), 525 525 'dl' => array(), 526 'dt' => array(), 526 'dt' => array( 527 'id' => true, 528 ), 527 529 'dd' => array(), 528 530 'li' => array(), -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/section-faq.js
r9005 r10573 11 11 // If there is no ID, create our own. 12 12 if ( ! id ) { 13 id = '#' + encodeURIComponent( $question.text().toLowerCase() );13 id = '#' + encodeURIComponent( $question.text().toLowerCase().trim() ); 14 14 $question.attr( 'id', id ); 15 15 } … … 43 43 44 44 if ( window.location.hash ) { 45 questions.find( '[formaction="' + window.location.hash + '"]' ).trigger( 'click' ); 45 jQuery( 46 // Decode/Encode here is to work with any existing links that are not fully-encoded, the trim handles whitespace/newlines. 47 document.getElementById( encodeURIComponent( decodeURIComponent( window.location.hash.substr(1) ).trim() ) ) 48 ).trigger( 'click' ); 46 49 } 47 50 } )( jQuery );
Note: See TracChangeset
for help on using the changeset viewer.