Title: [Plugin: WP-CodeBox] WordPress Editor just keep lang attribut
Last modified: August 20, 2016

---

# [Plugin: WP-CodeBox] WordPress Editor just keep lang attribut

 *  [HDready Graphic](https://wordpress.org/support/users/hdready-graphic/)
 * (@hdready-graphic)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-codebox-wordpress-editor-just-keep-lang-attribut/)
 * 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/](http://wordpress.org/extend/plugins/wp-codebox/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [HDready Graphic](https://wordpress.org/support/users/hdready-graphic/)
 * (@hdready-graphic)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-codebox-wordpress-editor-just-keep-lang-attribut/#post-2858013)
 * 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

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WP-CodeBox] WordPress Editor just keep lang attribut’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-codebox.svg)
 * [WP-CodeBox](https://wordpress.org/plugins/wp-codebox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-codebox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-codebox/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-codebox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-codebox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-codebox/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [HDready Graphic](https://wordpress.org/support/users/hdready-graphic/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-codebox-wordpress-editor-just-keep-lang-attribut/#post-2858013)
 * Status: not resolved