Changeset 3067344
- Timestamp:
- 04/09/2024 07:34:36 AM (2 years ago)
- Location:
- wp-codemirror-block
- Files:
-
- 4 edited
-
tags/2.0.3/readme.txt (modified) (2 diffs)
-
trunk/includes/class-codemirror-blocks.php (modified) (2 diffs)
-
trunk/index.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-codemirror-block/tags/2.0.3/readme.txt
r3067335 r3067344 5 5 Requires at least: 6.0 6 6 Tested up to: 6.5 7 Stable tag: 2.0. 27 Stable tag: 2.0.3 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 24 24 25 25 26 **New features include**27 28 * (New) Control Panel Added on top of the Code Block.29 ** It displays language/filename.30 ** It also display three buttons, includes Run/Execute, FullScreen, Copy Code.31 * (New) Web editor (Execution of HTML, CSS JavaScript block) With CodeMirror Block 1.132 * (Updated) Code block is now CodeMirror Block 1.133 * (New) Option Page for set default options34 * (New) Highlight Active Line (now available on CodeMirror Block 1.1)35 * (New) CodeMirror Block 1.1 now support Block align (Wide Width, Full Width) if your theme Supports.36 * (New) Classic Editor Support (Partial)37 38 26 **Features** 27 28 * Control Panel Added on top of the Code Block. 29 ** It displays language/filename. 30 ** It also display three buttons, includes Run/Execute, FullScreen, Copy Code. 31 * Web editor (Execution of HTML, CSS JavaScript block) With CodeMirror Block 1.1 32 * Option Page for set default options 33 * Highlight Active Line (now available on CodeMirror Block 1.1) 34 * CodeMirror Block 1.1 now support Block align (Wide Width, Full Width) if your theme Supports. 35 * Classic Editor Support (Partial) 36 39 37 40 38 * Lightweight and fast -
wp-codemirror-block/trunk/includes/class-codemirror-blocks.php
r3066625 r3067344 312 312 313 313 $editor_option = Settings::get_options(); 314 315 \ob_start(); 314 // \ob_start(); 315 // echo '<pre>'; 316 // print_r($block); 317 // echo '</pre><br />'; 316 318 // echo '<pre>'.\json_encode($editor_option, JSON_PRETTY_PRINT ).'</pre><br />'; 319 $block_class = ''; 317 320 $attributes = wp_parse_args($attributes, $editor_option['editor']); 318 321 $attributes = wp_parse_args($attributes, $editor_option['panel']); … … 343 346 if (!empty($is_new_block)) { 344 347 // add class and data attribute. 345 $content = \str_ireplace('<div class="wp-block-codemirror-blocks-code-block code-block"><pre>', '', $content); 346 $content = \str_ireplace('</pre></div>', '', $content); 348 $content = \str_ireplace('<pre', '<pre class="CodeMirror" data-setting="%1$s"', $content); 347 349 } else { 348 350 // for backward compatibility. 349 $content = \str_ireplace('<div class="wp-block-codemirror-blocks-code-block code-block">', '', $content);350 $content = \str_ireplace('</div>', '', $content);351 351 $content = preg_replace('/ data-setting="[\s\S]*?"/', ' data-setting="%1$s"', $content); 352 352 } 353 //$content = sprintf($content, esc_attr(wp_json_encode($attributes, JSON_UNESCAPED_SLASHES)));353 $content = sprintf($content, esc_attr(wp_json_encode($attributes, JSON_UNESCAPED_SLASHES))); 354 354 } else if (!empty($attributes['content'])) { 355 355 $content = $attributes['content']; 356 356 unset($attributes['content']); 357 357 } 358 echo '<div class="wp-block-codemirror-blocks-code-block code-block">'; 359 printf( 360 '<pre class="CodeMirror" data-setting="%s">', 361 esc_attr(wp_json_encode($attributes, JSON_UNESCAPED_SLASHES)), 362 ); 363 printf('%s', esc_html($content)); 364 echo '</pre>'; 365 echo '</div>'; 366 return \ob_get_clean(); 358 return $content; 367 359 } 368 360 } -
wp-codemirror-block/trunk/index.php
r3066625 r3067344 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.0 9 * Version: 2.0. 29 * Version: 2.0.3 10 10 * Author: Vicky Agravat 11 11 * Author URI: https://profiles.wordpress.org/vickyagravat -
wp-codemirror-block/trunk/readme.txt
r3066625 r3067344 5 5 Requires at least: 6.0 6 6 Tested up to: 6.5 7 Stable tag: 2.0. 27 Stable tag: 2.0.3 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 24 24 25 25 26 **New features include**27 28 * (New) Control Panel Added on top of the Code Block.29 ** It displays language/filename.30 ** It also display three buttons, includes Run/Execute, FullScreen, Copy Code.31 * (New) Web editor (Execution of HTML, CSS JavaScript block) With CodeMirror Block 1.132 * (Updated) Code block is now CodeMirror Block 1.133 * (New) Option Page for set default options34 * (New) Highlight Active Line (now available on CodeMirror Block 1.1)35 * (New) CodeMirror Block 1.1 now support Block align (Wide Width, Full Width) if your theme Supports.36 * (New) Classic Editor Support (Partial)37 38 26 **Features** 27 28 * Control Panel Added on top of the Code Block. 29 ** It displays language/filename. 30 ** It also display three buttons, includes Run/Execute, FullScreen, Copy Code. 31 * Web editor (Execution of HTML, CSS JavaScript block) With CodeMirror Block 1.1 32 * Option Page for set default options 33 * Highlight Active Line (now available on CodeMirror Block 1.1) 34 * CodeMirror Block 1.1 now support Block align (Wide Width, Full Width) if your theme Supports. 35 * Classic Editor Support (Partial) 36 39 37 40 38 * Lightweight and fast … … 174 172 == Changelog == 175 173 174 = 2.0.3 = 175 * Fix: [Adding ADDITIONAL CSS CLASS(ES) breaks the code](https://wordpress.org/support/topic/adding-additional-css-classes-breaks-the-code/) 176 * Fix: Extra line at the end of the code. 177 176 178 = 2.0.2 = 177 179 * Fix: [Everything is duplicated](https://wordpress.org/support/topic/everything-is-duplicated) code block rendered twice bug.
Note: See TracChangeset
for help on using the changeset viewer.