WordPress.org

Forums

WP-CodeBox
WordPress Editor just keep lang attribut (2 posts)

  1. HDready Graphic
    Member
    Posted 2 years ago #

    Hi,
    when I update an article, the <pre> is well saved, but when I edit it, all the attributs excepted "lang" are removed (in the editor) :/

    Thanks,
    Greg
    http://wordpress.org/extend/plugins/wp-codebox/

  2. HDready Graphic
    Member
    Posted 2 years ago #

    Ok, I have change the line 125 by :
    return preg_replace_callback("/\s*<pre(?:data\-code\-lang=[\"']([\w-]*)[\"']|data\-code\-file=[\"']([\w-]*\.?[\w-]*)[\"']|data\-code\-colla=[\"']([\+\-])[\"']|data\-code\-line=[\"'](\d*|n)[\"']|\s)+>(.*)<\/pre>\s*/siU", "wp_codebox_substitute", $content);
    And the line 74 by :
    $code = html_entity_decode(wp_codebox_code_trim($match[5]));

    The second is a correction for the html entities, the first change the code : lang="xxx" colla="+" file="xxx" line="n" by data-code-lang="xxx" data-code-colla="+" data-code-file="xxx" line="n" So in this case, the parameters are saved and it's valid html5.

    Regards,
    Greg

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-CodeBox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.