WordPress.org

Making WordPress.org

Changeset 9057


Ignore:
Timestamp:
07/18/2019 09:37:34 PM (17 months ago)
Author:
coffee2code
Message:

Breathe: Fix double-encoding of > character in code shortcodes.

Props dingo_d, coffee2code.
See [8843].
Fixes #4457.

File:
1 edited

Legend:

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

    r8286 r9057  
    222222
    223223/**
     224 * Fixes bug in (or at least in using) SyntaxHighlighter code shortcodes that
     225 * causes double-encoding of `>` character.
     226 *
     227 * @param string $content The text being handled as code.
     228 * @return string
     229 */
     230function fix_code_entity_encoding( $content ) {
     231    return str_replace( '>', '>', $content );
     232}
     233add_filter( 'syntaxhighlighter_htmlresult', __NAMESPACE__ . '\fix_code_entity_encoding', 20 );
     234
     235/**
    224236 * Register translations for plugins without their own GlotPress project.
    225237 */
Note: See TracChangeset for help on using the changeset viewer.