Support » Plugin: SyntaxHighlighter Evolved » This plugin adds “amp;” to “&” character. Please fix.

  • ninjazhai

    (@ninjazhai)


    Hi there, on my blog here, see section 5.4 and you will see this code:

    if(
    !empty($user->firstname) &&
    !empty($user->email) &&
    !empty($user->password) &&
    $user->create()
    )

    This plugin adds “amp;” to “&” character. It must look like this:

    if(
    !empty($user->firstname) &&
    !empty($user->email) &&
    !empty($user->password) &&
    $user->create()
    )

    Please fix. Thank you.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • billjojo

    (@billjojo)

    @ninjazhai I noticed you are using an Enfold child theme. Does it do this in the base theme? I tried 5 themes on my test 5.3.2 and cannot recreate this. I do not have Enfold as it is premium.

    Bill

    Plugin Author Alex Sanford

    (@alexsanford1)

    This issue has been reported here – https://github.com/Automattic/syntaxhighlighter/issues/98

    And there may be another context in which this issue appears, reported here – https://github.com/Automattic/syntaxhighlighter/issues/98

    Thread Starter ninjazhai

    (@ninjazhai)

    Hi @billjojo, yes, I tried it with the Enfold base theme and I still see the issue. I’m using the new WordPress blocks because I find it easier to edit there.

    Hi @alexsanford1, the thread is more than a year old. It looks like other users were able to find a hack. Can you include it in the official release soon?

    I think many people will appreciate it, including me and your employer. Thank you very much.

    Thread Starter ninjazhai

    (@ninjazhai)

    Hi @alexsanford1, thanks for the link. Thanks also to @iamntz. I was able to fix it by adding the following code on functions.php of my child theme.

    
    function ntz_fix_syntax_highlighter($content){
    	$content = str_replace('&&', '&&', $content);
    	$content = preg_replace('/&([^;]+;)/', '&$1', $content);
    
    	return $content;
    }
    
    add_filter('content_save_pre', 'ntz_fix_syntax_highlighter');
    Plugin Author Alex Sanford

    (@alexsanford1)

    Thank you. The issue is in our queue, but I cannot with say with certainty when it will be worked on. I’m glad you were able to find a workaround that fixes it for you 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘This plugin adds “amp;” to “&” character. Please fix.’ is closed to new replies.