Making WordPress.org


Ignore:
Timestamp:
01/13/2021 01:24:14 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: When generating FAQ anchors, don't include trailing whitespace as part of the ID.

This also updates the format of pre-defined ID's to match the format used today, as the ID's were previously being stripped out by kses, there's no real change here.

The Decode/Encode and trimming works around the various different anchor formats used.

Fixes #5572.

File:
1 edited

Legend:

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

    r10566 r10573  
    428428                $this->sections['faq'] .= "\n<dl>\n";
    429429                foreach ( $this->faq as $question => $answer ) {
    430                     $question_slug          = sanitize_title_with_dashes( $question );
     430                    $question_slug          = rawurlencode( trim( strtolower( $question ) ) );
    431431                    $this->sections['faq'] .= "<dt id='{$question_slug}'><h3>{$question}</h3></dt>\n<dd>{$answer}</dd>\n";
    432432                }
     
    524524            'ol'         => array(),
    525525            'dl'         => array(),
    526             'dt'         => array(),
     526            'dt'         => array(
     527                'id' => true,
     528            ),
    527529            'dd'         => array(),
    528530            'li'         => array(),
Note: See TracChangeset for help on using the changeset viewer.