Plugin Directory

Changeset 2004417

Timestamp:
12/31/2018 11:58:17 PM (6 years ago)
Author:
Viper007Bond
Message:

v3.5.0: https://github.com/Viper007Bond/syntaxhighlighter/releases/tag/v3.5.0

Location:
syntaxhighlighter/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • syntaxhighlighter/trunk

    • Property svn:ignore
      •  

        old new  
        1717phpunit.xml.dist
        1818tests
         19
         20
         21
         22
  • syntaxhighlighter/trunk/dist/blocks.build.js

    r1987121 r2004417  
    1 !function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t){var n=wp.i18n.__,r=wp.blocks.registerBlockType,a=wp.editor,l=a.InspectorControls,i=a.PlainText,o=wp.components,s=o.PanelBody,g=o.PanelRow;r("syntaxhighlighter/code",{title:n("SyntaxHighlighter Code","syntaxhighlighter"),description:n("Adds syntax highlighting to source code (front end only).","syntaxhighlighter"),icon:"editor-code",category:"formatting",keywords:[n("Source","syntaxhighlighter"),n("Program","syntaxhighlighter"),n("Develop","syntaxhighlighter")],attributes:{content:{type:"string",source:"text",selector:"pre"},language:{type:"string",default:"plain"}},supports:{html:!1},transforms:{from:[{type:"pattern",trigger:"enter",regExp:/^```$/,transform:function(){return createBlock("syntaxhighlighter/code")}},{type:"raw",isMatch:function(e){return"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName},schema:{pre:{children:{code:{children:{"#text":{}}}}}}}]},edit:function(e){var t=e.className,r=e.setAttributes,a=e.attributes,o=a.content,h=a.language,c=[];for(var u in syntaxHighlighterData.brushes)c.push(wp.element.createElement("option",{key:u,value:u},syntaxHighlighterData.brushes[u]));return[wp.element.createElement(l,{key:"syntaxHighlighterInspectorControls"},wp.element.createElement(s,{title:"Settings"},wp.element.createElement(g,null,wp.element.createElement("label",{htmlFor:"syntaxhighlighter-language"},n("Code Language","syntaxhighlighter")),wp.element.createElement("select",{id:"syntaxhighlighter-language",value:h,onChange:function(e){r({language:e.target.value})}},c)))),wp.element.createElement("div",{className:t+" wp-block-code",key:"syntaxHighlighterEditView"},wp.element.createElement(i,{placeholder:n("Tip: Choose a code language from the block settings to the right.","syntaxhighlighter"),className:"editor-plain-text",value:o,"aria-label":n("SyntaxHighlighter Code","syntaxhighlighter"),onChange:function(e){return r({content:e})}}))]},save:function(e){var t=e.attributes,n=t.content,r=t.language;return wp.element.createElement("pre",{className:"brush: "+r+"; notranslate"},n)}})}]);
     1!function(e){function t(r){if(n[r])return n[r].exports;var }]);
  • syntaxhighlighter/trunk/readme.txt

    r1998464 r2004417  
    3333== Screenshots ==
    3434
    35 1. Example code display of some PHP inside some HTML.
    36 2. A part of the Settings page which controls the defaults.
     351. Example .
     362. A.
    3737
    3838== ChangeLog ==
     39
     40
     41
     42
     43
    3944
    4045= Version 3.4.2 =
  • syntaxhighlighter/trunk/syntaxhighlighter.php

    r1998464 r2004417  
    44
    55Plugin Name:  SyntaxHighlighter Evolved
    6 Plugin URI:   http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/
    7 Version:      3.4.2
    8 Description:  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.
     6Plugin URI:   http/wordpress-plugins/syntaxhighlighter/
     7Version:      3.
     8Description:  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/.
    99Author:       Alex Mills (Viper007Bond)
    10 Author URI:   http://www.viper007bond.com/
    11 
    12 **************************************************************************
    13 
    14 Thanks to:
    15 
    16 * Alex Gorbatchev for writing the Javascript-powered syntax highlighter script
    17 
    18 * Andrew Ozz for writing the TinyMCE plugin
     10Author URI:   https://alex.blog/
     11Text Domain:  syntaxhighlighter
     12License:      GPL2
     13License URI:  https://www.gnu.org/licenses/gpl-2.0.html
    1914
    2015**************************************************************************/
     
    2217class SyntaxHighlighter {
    2318    // All of these variables are private. Filters are provided for things that can be modified.
    24     var $pluginver            = '3.4.2';  // Plugin version
     19    var $pluginver            = '3.';  // Plugin version
    2520    var $agshver              = false;    // Alex Gorbatchev's SyntaxHighlighter version (dynamically set below due to v2 vs v3)
    2621    var $shfolder             = false;    // Controls what subfolder to load SyntaxHighlighter from (v2 or v3)
     
    8075            add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
    8176            add_action( 'the_content', array( $this, 'enable_brushes_used_in_blocks' ), 0 );
     77
     78
     79
     80
     81
     82
    8283        }
    8384
     
    260261        ) );
    261262
     263
     264
     265
     266
     267
     268
     269
    262270        // Create a list of shortcodes to use. You can use the filter to add/remove ones.
    263271        // If the language/lang parameter is left out, it's assumed the shortcode name is the language.
     
    326334        }
    327335
    328         natsort( $this->brush_names );
     336        natcasesort( $this->brush_names );
     337
     338        $settings = (object) array(
     339            'language' => (object) array(
     340                'supported' => true,
     341                'default' => 'plain'
     342            ),
     343            'lineNumbers' => (object) array(
     344                'supported' => true,
     345                'default' => (bool) $this->settings['gutter'],
     346            ),
     347            'firstLineNumber' => (object) array(
     348                'supported' => true,
     349                'default' => $this->settings['firstline'],
     350            ),
     351            'highlightLines' => (object) array(
     352                'supported' => true,
     353                'default' => '',
     354            ),
     355            'wrapLines' => (object) array(
     356                'supported' => ( '2' == $this->settings['shversion'] ),
     357                'default' => (bool) $this->settings['wraplines'],
     358            ),
     359            'makeURLsClickable' => (object) array(
     360                'supported' => true,
     361                'default' => (bool) $this->settings['autolinks'],
     362            ),
     363        );
    329364
    330365        wp_add_inline_script(
     
    333368                var syntaxHighlighterData = {
    334369                    brushes: %s,
     370
    335371                };',
    336                 json_encode( $this->brush_names )
     372                json_encode( $this->brush_names ),
     373                json_encode( $settings )
    337374            ),
    338375            'before'
     
    366403            && ! has_block( 'core/block', $content ) // Reusable
    367404        ) {
    368             //return $content;
     405            return $content;
    369406        }
    370407
     
    444481
    445482        return $content;
     483
     484
     485
     486
     487
     488
     489
     490
     491
     492
     493
     494
     495
     496
     497
     498
     499
     500
     501
     502
     503
     504
     505
     506
     507
     508
     509
     510
     511
     512
     513
     514
     515
     516
     517
     518
     519
     520
    446521    }
    447522
Note: See TracChangeset for help on using the changeset viewer.