Plugin Directory

Changeset 3067344


Ignore:
Timestamp:
04/09/2024 07:34:36 AM (2 years ago)
Author:
vickyagravat
Message:

Update Release: 2.0.3

Location:
wp-codemirror-block
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-codemirror-block/tags/2.0.3/readme.txt

    r3067335 r3067344  
    55Requires at least: 6.0
    66Tested up to: 6.5
    7 Stable tag: 2.0.2
     7Stable tag: 2.0.3
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    2424
    2525
    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.1
    32 * (Updated) Code block is now CodeMirror Block 1.1
    33 * (New) Option Page for set default options
    34 * (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 
    3826**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
    3937
    4038* Lightweight and fast
  • wp-codemirror-block/trunk/includes/class-codemirror-blocks.php

    r3066625 r3067344  
    312312
    313313    $editor_option = Settings::get_options();
    314 
    315     \ob_start();
     314    // \ob_start();
     315    // echo '<pre>';
     316    // print_r($block);
     317    // echo '</pre><br />';
    316318    // echo '<pre>'.\json_encode($editor_option, JSON_PRETTY_PRINT ).'</pre><br />';
     319    $block_class = '';
    317320    $attributes = wp_parse_args($attributes, $editor_option['editor']);
    318321    $attributes = wp_parse_args($attributes, $editor_option['panel']);
     
    343346      if (!empty($is_new_block)) {
    344347        // 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);
    347349      } else {
    348350        // for backward compatibility.
    349         $content = \str_ireplace('<div class="wp-block-codemirror-blocks-code-block code-block">', '', $content);
    350         $content = \str_ireplace('</div>', '', $content);
    351351        $content = preg_replace('/ data-setting="[\s\S]*?"/', ' data-setting="%1$s"', $content);
    352352      }
    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)));
    354354    } else if (!empty($attributes['content'])) {
    355355      $content = $attributes['content'];
    356356      unset($attributes['content']);
    357357    }
    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;
    367359  }
    368360}
  • wp-codemirror-block/trunk/index.php

    r3066625 r3067344  
    77 * Requires at least: 6.0
    88 * Requires PHP:      7.0
    9  * Version:                     2.0.2
     9 * Version:                     2.0.3
    1010 * Author:                  Vicky Agravat
    1111 * Author URI:              https://profiles.wordpress.org/vickyagravat
  • wp-codemirror-block/trunk/readme.txt

    r3066625 r3067344  
    55Requires at least: 6.0
    66Tested up to: 6.5
    7 Stable tag: 2.0.2
     7Stable tag: 2.0.3
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    2424
    2525
    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.1
    32 * (Updated) Code block is now CodeMirror Block 1.1
    33 * (New) Option Page for set default options
    34 * (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 
    3826**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
    3937
    4038* Lightweight and fast
     
    174172== Changelog ==
    175173
     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
    176178= 2.0.2 =
    177179* 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.