• Resolved amatheson

    (@amatheson)


    I recently upgraded a client to the latest version of MBT and found that TinyMCE was suddenly available on the teaser blurbs. I thought that was a great addition as it has been a pain to manually add the HTML when needed. However, when I tried using it, saving the HTML resulted in the encoded HTML being returned in the editor. Thus

    <strong>The title is this.</strong>

    Became:

    <strong>The title is this.</strong>

    If I used the TinyMCE tools to set the text to bold and saved it, the bold text is saved properly to the DB, but then when the page is redisplayed, the HTML tags are shown. Thus if I save it again, it screws up the HTML because the tags are transformed into the encoded versions. It seems like you are missing something in the display routines that’s causing the HTML to be output as encoded text rather than proper HTML.

    To work around this, I’ve had to disable TinyMCE on that field:

    add_filter('wp_editor_settings', function( $settings, $editor_id ) {
        if ($editor_id != 'excerpt')
            return $settings;
    
        $settings['tinymce'] = false;
    
        return $settings;
    }, 10, 2);
    • This topic was modified 6 years, 8 months ago by amatheson.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter amatheson

    (@amatheson)

    The editor here is not showing things properly… but essentially after saving, the HTML is encoded when it is sent back to the editor.

    • This reply was modified 6 years, 8 months ago by amatheson.
    • This reply was modified 6 years, 8 months ago by amatheson.
    Plugin Author zookatron

    (@zookatron)

    Hi @amatheson,

    Thanks so much for letting us know about this! We just released an hotfix that should resolve this issue.

    We copied the same code we were using for the “About the Book” section and thought it would work the same for the “Book Blurb” section, but apparently WordPress does some extra processing to the book_excerpt field (which is where we store the book blurb) that messes with tag encoding. We definitely should have tested that out a bit more before putting it into the last release though, definitely an oversight on our part. Thanks for helping us out.

    ~Tim

    Thread Starter amatheson

    (@amatheson)

    Thanks, Tim – I’ll test it out and report back if I see any other issues.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use of wp_editor in blurbs causes encoding issues’ is closed to new replies.