Changeset 3067335
- Timestamp:
- 04/09/2024 07:19:05 AM (2 years ago)
- Location:
- wp-codemirror-block/tags/2.0.3
- Files:
-
- 3 edited
-
includes/class-codemirror-blocks.php (modified) (2 diffs)
-
index.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-codemirror-block/tags/2.0.3/includes/class-codemirror-blocks.php
r3066625 r3067335 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/tags/2.0.3/index.php
r3066625 r3067335 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/tags/2.0.3/readme.txt
r3066625 r3067335 174 174 == Changelog == 175 175 176 = 2.0.3 = 177 * Fix: [Adding ADDITIONAL CSS CLASS(ES) breaks the code](https://wordpress.org/support/topic/adding-additional-css-classes-breaks-the-code/) 178 * Fix: Extra line at the end of the code. 179 176 180 = 2.0.2 = 177 181 * 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.