Plugin Directory

Changeset 1988517

Timestamp:
12/08/2018 12:44:21 AM (6 years ago)
Author:
Viper007Bond
Message:

https://github.com/Viper007Bond/syntaxhighlighter/releases/tag/v.3.4.1

Location:
syntaxhighlighter/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • syntaxhighlighter/trunk/readme.txt

    r1987121 r1988517  
    22Contributors: Viper007Bond, automattic
    33Donate link: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/donate/
    4 Tags: code, sourcecode, php, xhtml, html, css, WordPress.com
     4Tags: code, sourcecode, php, xhtml, html, css, WordPress.com
    55Requires at least: 4.2.3
    66Tested up to: 5.0
     
    1111== Description ==
    1212
     13
     14
    1315SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without losing its formatting or making any manual changes. It uses the [SyntaxHighlighter JavaScript package by Alex Gorbatchev](http://alexgorbatchev.com/wiki/SyntaxHighlighter).
    1416
     
    3537
    3638== ChangeLog ==
     39
     40
     41
     42
    3743
    3844= Version 3.4.0 =
  • syntaxhighlighter/trunk/syntaxhighlighter.php

    r1987121 r1988517  
    55Plugin Name:  SyntaxHighlighter Evolved
    66Plugin URI:   http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/
    7 Version:      3.4.0
     7Version:      3.4.
    88Description:  Easily post syntax-highlighted code to your site without having to modify the code at all. Uses Alex Gorbatchev's <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a>. <strong>TIP:</strong> Don't use the Visual editor if you don't want your code mangled. TinyMCE will "clean up" your HTML.
    99Author:       Alex Mills (Viper007Bond)
     
    2222class SyntaxHighlighter {
    2323    // All of these variables are private. Filters are provided for things that can be modified.
    24     var $pluginver            = '3.4.0';  // Plugin version
     24    var $pluginver            = '3.4.';  // Plugin version
    2525    var $agshver              = false;    // Alex Gorbatchev's SyntaxHighlighter version (dynamically set below due to v2 vs v3)
    2626    var $shfolder             = false;    // Controls what subfolder to load SyntaxHighlighter from (v2 or v3)
     
    7474
    7575        // Editor Blocks
    76         if ( function_exists( 'parse_blocks' ) ) {
     76        if (
     77            function_exists( 'parse_blocks' ) // WordPress 5.0+
     78            || function_exists( 'the_gutenberg_project' ) // Gutenberg plugin for older WordPress
     79        ) {
    7780            add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
    7881            add_action( 'the_content', array( $this, 'enable_brushes_used_in_blocks' ), 0 );
     
    318321        );
    319322
    320         wp_set_script_translations( 'syntaxhighlighter-blocks', 'syntaxhighlighter' );
     323        // WordPress 5.0+ only, no Gutenberg plugin support
     324        if ( function_exists( 'wp_set_script_translations' ) ) {
     325            wp_set_script_translations( 'syntaxhighlighter-blocks', 'syntaxhighlighter' );
     326        }
    321327
    322328        natsort( $this->brush_names );
     
    354360        }
    355361
    356         $blocks = parse_blocks( $content );
     362        if ( function_exists( 'parse_blocks' ) ) { // WP 5.0+
     363            $blocks = parse_blocks( $content );
     364        } elseif ( Function_exists( 'gutenberg_parse_blocks' ) ) { // Gutenberg plugin
     365            $blocks = gutenberg_parse_blocks( $content );
     366        } else {
     367            return $content;
     368        }
    357369
    358370        foreach ( $blocks as $block ) {
Note: See TracChangeset for help on using the changeset viewer.