Changeset 2004417
- Timestamp:
- 12/31/2018 11:58:17 PM (6 years ago)
- Location:
- syntaxhighlighter/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
syntaxhighlighter/trunk
- Property svn:ignore
-
old new 17 17 phpunit.xml.dist 18 18 tests 19 20 21 22
-
- Property svn:ignore
-
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 33 33 == Screenshots == 34 34 35 1. Example code display of some PHP inside some HTML.36 2. A part of the Settings page which controls the defaults.35 1. Example . 36 2. A. 37 37 38 38 == ChangeLog == 39 40 41 42 43 39 44 40 45 = Version 3.4.2 = -
syntaxhighlighter/trunk/syntaxhighlighter.php
r1998464 r2004417 4 4 5 5 Plugin Name: SyntaxHighlighter Evolved 6 Plugin URI: http ://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/7 Version: 3. 4.28 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.6 Plugin URI: http/wordpress-plugins/syntaxhighlighter/ 7 Version: 3. 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/. 9 9 Author: 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 10 Author URI: https://alex.blog/ 11 Text Domain: syntaxhighlighter 12 License: GPL2 13 License URI: https://www.gnu.org/licenses/gpl-2.0.html 19 14 20 15 **************************************************************************/ … … 22 17 class SyntaxHighlighter { 23 18 // All of these variables are private. Filters are provided for things that can be modified. 24 var $pluginver = '3. 4.2'; // Plugin version19 var $pluginver = '3.'; // Plugin version 25 20 var $agshver = false; // Alex Gorbatchev's SyntaxHighlighter version (dynamically set below due to v2 vs v3) 26 21 var $shfolder = false; // Controls what subfolder to load SyntaxHighlighter from (v2 or v3) … … 80 75 add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) ); 81 76 add_action( 'the_content', array( $this, 'enable_brushes_used_in_blocks' ), 0 ); 77 78 79 80 81 82 82 83 } 83 84 … … 260 261 ) ); 261 262 263 264 265 266 267 268 269 262 270 // Create a list of shortcodes to use. You can use the filter to add/remove ones. 263 271 // If the language/lang parameter is left out, it's assumed the shortcode name is the language. … … 326 334 } 327 335 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 ); 329 364 330 365 wp_add_inline_script( … … 333 368 var syntaxHighlighterData = { 334 369 brushes: %s, 370 335 371 };', 336 json_encode( $this->brush_names ) 372 json_encode( $this->brush_names ), 373 json_encode( $settings ) 337 374 ), 338 375 'before' … … 366 403 && ! has_block( 'core/block', $content ) // Reusable 367 404 ) { 368 //return $content;405 return $content; 369 406 } 370 407 … … 444 481 445 482 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 446 521 } 447 522
Note: See TracChangeset
for help on using the changeset viewer.