Making WordPress.org

Changeset 9061


Ignore:
Timestamp:
07/18/2019 10:37:35 PM (6 years ago)
Author:
coffee2code
Message:

Breathe: Expand fix for double-encoding by SyntaxHighligher to apply to & character as well.

Props garrett-eclipse, coffee2code.
See #4457.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r9057 r9061  
    223223/**
    224224 * Fixes bug in (or at least in using) SyntaxHighlighter code shortcodes that
    225  * causes double-encoding of `>` character.
     225 * causes double-encoding of `>` and '&' characters.
    226226 *
    227227 * @param string $content The text being handled as code.
     
    229229 */
    230230function fix_code_entity_encoding( $content ) {
    231     return str_replace( '>', '>', $content );
     231    return str_replace( [ '>', '&' ], [ '>', '&' ], $content );
    232232}
    233233add_filter( 'syntaxhighlighter_htmlresult', __NAMESPACE__ . '\fix_code_entity_encoding', 20 );
Note: See TracChangeset for help on using the changeset viewer.