{"id":4345,"date":"2008-12-30T12:15:35","date_gmt":"2008-12-30T12:15:35","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-synhighlight\/"},"modified":"2016-01-11T17:50:47","modified_gmt":"2016-01-11T17:50:47","slug":"wp-synhighlight","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/wp-synhighlight\/","author":1141564,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.4.3","stable_tag":"trunk","tested":"4.4.34","requires":"2.8","requires_php":"","requires_plugins":"","header_name":"WP-SynHighlight","header_author":"Vladislav \"FractalizeR\" Rastrusny","header_description":"","assets_banners_color":"","last_updated":"2016-01-11 17:50:47","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.fractalizer.ru","header_plugin_uri":"http:\/\/www.fractalizer.ru\/freeware-projects\/wordpress-plugins\/wp-synhighlight\/","header_author_uri":"http:\/\/www.fractalizer.ru","rating":4.6,"author_block_rating":0,"active_installs":100,"downloads":32867,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"":"<ul>\n<li>No need to care about upgrade so far ;) Just overwrite old files with new ones or use WordPress plugin autoupgrade feature<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":"2","5":"3"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-4.jpg":{"filename":"screenshot-4.jpg","revision":"1567236","resolution":"4","location":"plugin"},"screenshot-2.jpg":{"filename":"screenshot-2.jpg","revision":"1567236","resolution":"2","location":"plugin"},"screenshot-3.jpg":{"filename":"screenshot-3.jpg","revision":"1567236","resolution":"3","location":"plugin"},"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":"1567236","resolution":"1","location":"plugin"}},"screenshots":{"1":"GUI Mode Editor button","2":"When you press button, you see code formatting settings","3":"and you can edit code in-place with realtime syntax highlighting","4":"The result of pasting code in GUI Mode Editor button"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1214,1975,3986,2207,18593],"plugin_category":[46],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-4345","plugin","type-plugin","status-publish","hentry","plugin_tags-code","plugin_tags-formatting","plugin_tags-highlight","plugin_tags-syntax","plugin_tags-syntax-highlight","plugin_category-editor-and-writing","plugin_committers-fractalizer"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-synhighlight.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-synhighlight\/trunk\/screenshot-1.jpg?rev=1567236","caption":"GUI Mode Editor button"},{"src":"https:\/\/ps.w.org\/wp-synhighlight\/trunk\/screenshot-2.jpg?rev=1567236","caption":"When you press button, you see code formatting settings"},{"src":"https:\/\/ps.w.org\/wp-synhighlight\/trunk\/screenshot-3.jpg?rev=1567236","caption":"and you can edit code in-place with realtime syntax highlighting"},{"src":"https:\/\/ps.w.org\/wp-synhighlight\/trunk\/screenshot-4.jpg?rev=1567236","caption":"The result of pasting code in GUI Mode Editor button"}],"raw_content":"<!--section=description-->\n<p>Plugin provides syntax highlighting in posts and comments.<\/p>\n\n<ul>\n<li><strong>Full GUI<\/strong> mode. No need to switch to code mode and back like in some other plugins<\/li>\n<li><strong>GUI editor<\/strong> with <strong>realtime<\/strong> syntax highligting support integrated (can be disable in settings)<\/li>\n<li><strong>GUI button<\/strong> to help with highlighting options. No need to memorize them!<\/li>\n<li>Blog-wide default settings for code highlighting. Now you can change the look of all your posts at once!<\/li>\n<li>Many options to customize code highlighting (almost full Geshi set)<\/li>\n<\/ul>\n\n<p>If you like this plugin, you can make a donation with WebMoney (R704473788938, R704473788938), Yandex.Money (41001122895969), MoneyBookers (FractalizeR@yandex.ru)<\/p>\n\n<h3>Usage<\/h3>\n\n<p>Just select all your source code in the editor and use editor button (preferred method) or surround your code directly in WYSIWYG editor with a [codesyntax] [\/codesyntax] tag like this<\/p>\n\n<p>[codesyntax lang=\"php\"]<\/p>\n\n<pre><code>&lt;?php \n\/\/Replacing tags\n$find [] = '\/&lt;br\\s*\\\\?&gt;\/i';\n$replace [] = \"\\r\\n\";\n$content = preg_replace($find, $replace, $content);\n?&gt;\n<\/code><\/pre>\n\n<p>[\/codesyntax]<\/p>\n\n<p>[filesyntax filename=\"test.phps\" lang=\"php\"]<\/p>\n\n<p>The tag in the last example should be enabled in settings. See it's description below also.<\/p>\n\n<p>and you will get wonderful geshi formatting. Format all your source code with Preformatted style to preserve spaces.<\/p>\n\n<p>If you need to change settings of already formatted block - select it all and press GUI editor button again. Plugin will recognize all settings you used.<\/p>\n\n<p>Plugin recognizes several popular geshi options to render highlighting:<\/p>\n\n<p><strong>filename<\/strong><\/p>\n\n<p>The relative filename of the file inside a folder, allowed for [filesyntax] tag to take the source for highlighting from. Works only in [filesyntax] tag<\/p>\n\n<p><strong>lang<\/strong><\/p>\n\n<p>The programming language you want to be your source highlighted in. [codesyntax lang=\"java\"]My java code goes here...[\/codesyntax]\nThe name of the language should match the name of the highlighter file. For the list of all supported highlighters please look at \/wp-content\/plugins\/wp-synhighlighter\/geshi\/geshi directory of your WordPress installation after installing this plugin. A list of currently support languages:<\/p>\n\n<p>abap, actionscript, actionscript3, ada, apache, applescript, <code>apt_sources<\/code>, asm, asp, autoit, avisynth, bash, basic4gl, blitzbasic, bnf, boo, c, caddcl, cadlisp, cfdg, cfm, cil, cobol, cpp-qt, cpp, csharp, css, <code>c_mac<\/code>, d, delphi, diff, div, dos, dot, eiffel, email, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, html4strict, idl, ini, inno, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, list.txt, lotusformulas, lotusscript, lua, m68k, make, matlab, mirc, mpasm, mxml, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle11, oracle8, pascal, per, perl, php-brief, php, pic16, plsql, povray, powershell, progress, prolog, python, qbasic, rails, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, visualfoxpro, winbatch, xml, xorg_conf, xpp, z80<\/p>\n\n<p><strong>lines<\/strong><\/p>\n\n<p>Do you want line numbers to be visible? Possible parameter values are:<\/p>\n\n<ul>\n<li><em>no<\/em> - no line numbers. [codesyntax lang=\"java\" lines=\"no\"]My java code[\/codesyntax]<\/li>\n<li><em>normal<\/em> = normal line numbering<\/li>\n<li><em>fancy<\/em> - fancy line numbering\nThis parameter defaults to fancy<\/li>\n<\/ul>\n\n<p><strong>lines_start<\/strong><\/p>\n\n<p>You can provide this parameter if you want your line numbering to start with a custom value. [codesyntax lang=\"java\" lines=\"fancy\" lines_start=\"1000\"]My java code[\/codesyntax]. Please don't forget to enclose a value into quotes exactly like in example\nBy default numbering starts with 1.<\/p>\n\n<p><strong>container<\/strong><\/p>\n\n<p>You can select container, that your code will be wrapped in<\/p>\n\n<ul>\n<li><em>pre<\/em><\/li>\n<li><em>div<\/em><\/li>\n<li><em>pre_valid<\/em><\/li>\n<li><em>pre_table<\/em><\/li>\n<li><em>none<\/em><\/li>\n<\/ul>\n\n<p>By default pre is used. [codesyntax lang=\"java\" container=\"pre\"]My java code[\/codesyntax]\nMore information can be found in <a href=\"http:\/\/qbnz.com\/highlighter\/geshi-doc.html#the-code-container\">Geshi documentation<\/a><\/p>\n\n<p><strong>capitalize<\/strong><\/p>\n\n<p>Do you wish your keywords to be automatically capitalized or decapitalized?<\/p>\n\n<ul>\n<li><em>no<\/em> - don't change anything<\/li>\n<li><em>upper<\/em> - convert all keywords into uppercase<\/li>\n<li><em>lower<\/em> - convert all keywords into lowercase\nBy default no change is assumed\n[codesyntax lang=\"java\" capitalize=\"upper\" lines_start=\"1000\"]<\/li>\n<\/ul>\n\n<p><strong>tab_width<\/strong><\/p>\n\n<p>If you want to change tab width, use this parameter: [codesyntax lang=\"java\" tab_width=\"10\"]<\/p>\n\n<p><strong>strict<\/strong><\/p>\n\n<p>This setting enables or disables strict mode for formatting complex pieces of data. Please see <a href=\"http:\/\/qbnz.com\/highlighter\/geshi-doc.html#using-strict-mode\">Geshi documentation<\/a> to find out more on the subject<\/p>\n\n<p><strong>title (new in 0.91)<\/strong><\/p>\n\n<p>This attribute sets the header of the collapsable code block (\"Code\" by default)<\/p>\n\n<p><strong>bookmarkname (new in 0.91)<\/strong><\/p>\n\n<p>The name of bookmark (Named anchor tag <code>&lt;a name=\"bookmarkname\" \/&gt;<\/code>) you want to refer to this codeblock. By default it is\n    codesyntaxX, where X is 1 for first code block on the page, 2 for second etc. You can refer to your codeblocks using hyperlinks\n    &lt; a href=\"#codesyntax5\"&gt;Link to fifth code block on the page or, if you used \n    [codesyntax bookmarkname=\"fifthcode\"] lang=\"php\" bbcode, you can then refer to this codeblock as<br \/>\n    &lt; a href=\"#fifthcode\"&gt;Link to fifth code block on the page<\/p>\n\n<p><strong>blockstate (new in 0.97)<\/strong>\nSets initial code block state when the page is shown to user. It can be default, expanded or collapsed. Default corresponds to expanded currently.<\/p>\n\n<p><strong>highlight_lines (new in 1.1)<\/strong>\nProvides a comma-separated list of lines, that should be specially highlighted in the code<\/p>\n\n<p><strong>doclinks (new in 2.3)<\/strong>\nEnables or disables generation of documentation links for keywords<\/p>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<ol>\n<li>Unpack plugin archive into <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<p>The below actions are not needed after installation. Just some customization.<\/p>\n\n<ol>\n<li>You can update Geshi if you like by downloading a new version from it's site and overwritting files in geshi folder of plugin. Geshi is untouched by me ;)<\/li>\n<li>You can customize collapsable code block by changing <code>wp-synhighlighter.css<\/code> file in the plugin folder<\/li>\n<li>You can change the template of the collapsable code block by editing <code>template.php<\/code> file<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Where do I send suggestions on improving the plugin?<\/dt>\n<dd><p>I am glad to accept offers or code patches for the plugin by email: <a href=\"mailto:&#x46;&#x72;&#097;&#x63;&#116;a&#x6c;&#105;&#x7a;&#101;&#082;&#x40;&#121;a&#x6e;&#100;&#x65;&#120;&#046;&#x72;&#117;\">FractalizeR@yandex.ru<\/a><\/p><\/dd>\n<dt>Why PHP scripts are not highlighted with your plugin?<\/dt>\n<dd><p>Please start PHP code you want to highlight from PHP tag &lt;?php and it will be highlighted just fine.<\/p><\/dd>\n<dt>Line spacing is crippled?<\/dt>\n<dd><p>If you write code in the editor, make newlines with Ctrl-Enter, not just enter. If you paste it - format it using an editor buttor or at least ensure you formatted all source using Preformatted style<\/p><\/dd>\n<dt>Why embedding styles option is marked as \"breaking\" and \"slow\"?<\/dt>\n<dd><ul>\n<li>Publishing  tag outisde  tag is breaking HTML validity<\/li>\n<li>Every time browser encounters  tag, it needs to rerender the whole page, because some styles could be redefined<\/li>\n<\/ul><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.4 (07.01.2015)<\/h4>\n\n<ul>\n<li>Tested with Wordpress 4.4.1<\/li>\n<\/ul>\n\n<h4>2.3.1 (22.02.2014)<\/h4>\n\n<ul>\n<li>Tested with Wordpress 3.8.1<\/li>\n<\/ul>\n\n<h4>2.3 (11.02.2011)<\/h4>\n\n<ul>\n<li>Added [filesytax] tag, that allows to insert into post files, highlighted from filesystem. Related security settings are added to options. The use of this tag should be enabled in options too.<\/li>\n<li>Due to security settings added to options, only blog admin is now allowed to change them<\/li>\n<li>Added doclinks_off settings option which enables you to control the generation of documentation URLs for keywords by default<\/li>\n<li>Added doclinks option to [codesyntax] and [filesyntax] tags to control the generation of documentation URLs per each source piece<\/li>\n<li>Several bugfixes<\/li>\n<li>User satisfactory texts are now displayed after some time of using plugin in settings<\/li>\n<li>Bugfix: comments are now highlighted correctly even when using external CSS styles for highlighting<\/li>\n<\/ul>\n\n<h4>2.2.7 (28.09.2010)<\/h4>\n\n<ul>\n<li>Critical bug fix (not all blogs affected though): slashes in theme folder name do not duplicate now<\/li>\n<\/ul>\n\n<h4>2.2.6 (24.09.2010)<\/h4>\n\n<ul>\n<li>wp-content is now movable\/renameable. Just don't forget to change theme path in WP-SynHighlight options if even you left it on defaults. For more details on the operation see <a href=\"http:\/\/codex.wordpress.org\/Editing_wp-config.php#Moving_wp-content\">Codex<\/a><\/li>\n<\/ul>\n\n<h4>2.2.5 (22.09.2010)<\/h4>\n\n<ul>\n<li>GUI Mode editor javascript bug fixed<\/li>\n<li>Comments display fixed, <code> tag eliminated. Will see, how it will go<\/code><\/li>\n<\/ul>\n\n<h4>2.2.4 (12.07.2010)<\/h4>\n\n<ul>\n<li>HTML validation bug fixed. Thanks to whallify for reporting and providing a fix<\/li>\n<\/ul>\n\n<h4>2.2.3 (06.07.2010)<\/h4>\n\n<ul>\n<li>Minor plugin activation bug fixed. Thanks to Aziz Light for reporting.<\/li>\n<\/ul>\n\n<h4>2.2.2 (03.05.2010)<\/h4>\n\n<ul>\n<li>Theme path fixes (when is set to be different from default). Thanks to chandima for reporting<\/li>\n<li><code>&lt;code&gt;<\/code> tags in comments eliminated. Thanks to Navarr for reporting<\/li>\n<li>Unicode symbols conversion bug fixed completely. Thanks to simplylinux.ch for reporting<\/li>\n<\/ul>\n\n<h4>2.2.1 (26.01.2010)<\/h4>\n\n<ul>\n<li>Theme path showed as unsaved in options. Now fixed thanks to Willington Vega for patch.<\/li>\n<\/ul>\n\n<h4>2.2 (12.01.2010)<\/h4>\n\n<ul>\n<li>Added option to set code block height in pixels. See plugin options.<\/li>\n<\/ul>\n\n<h4>2.1.1 (10.01.2010)<\/h4>\n\n<ul>\n<li>Small bug fixed with default CSS styling. It is set to old behaviour and can now be changed from options. External CSS option is preferred.<\/li>\n<li>Windows Live Writer compatibility introduced (it corrupts shortcodes a little sometimes)<\/li>\n<li>Localization updated to include some missing phrases<\/li>\n<\/ul>\n\n<h4>2.1 (10.01.2010)<\/h4>\n\n<ul>\n<li>An option added to output highlighting using CSS styles. See plugin options to control behaviour. Thanks to Artem Russakovskii for the concept and the idea.<\/li>\n<li>Warning added to remind users to start PHP code from &lt;?php tag to highlight properly<\/li>\n<li>Minor options bug fixed<\/li>\n<\/ul>\n\n<h4>2.0 (05.01.2010)<\/h4>\n\n<ul>\n<li>SuperGUI mode added. Now you can edit your source code and have a realtime code syntax highlighting.<\/li>\n<li>Now editor button supports detecting of existing shortcodes in text<\/li>\n<li>highlight_lines option empty behavior fixed<\/li>\n<li>GUI mode visualization of shortcode changed to full-pre for better display<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Added a possibility to select default code options on settings page. For example, you may set, that all code blocks on all pages should be collapsed by default<\/li>\n<li>Added highlight_lines parameter which you can set to a comma-delimited list of line numbers, that you need to be specially highlighted in the code block<\/li>\n<li>English localization fixed. <\/li>\n<li>Fixed box buttons border style if it is defined in CSS by your theme<\/li>\n<li>Added plugin settings link to the plugin description in the plugin list<\/li>\n<li>Russian localization added<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Geshi syntax highlighting for 1C language improved.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Box buttons border removed to comply with some styles.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Code initial state option added, for instance, to make code block collapsed by default when the page is opened by user<\/li>\n<li>Code block folding animation added<\/li>\n<li>Theming is now supported. See themes directory for details. You can set current theme in plugin options.<\/li>\n<li>Code block corners are now look rounded at least in Firefox. Stupid IE...<\/li>\n<li>Print code button added<\/li>\n<li>Show code only button added<\/li>\n<li>Padding bug of <\/li>\n<\/ul>\n\n<p>&lt;<\/p>\n\n<p>ol&gt; block fixed when line numbers are shown\n* Geshi updated to latest stable (1.0.8.4)\n* 1C language syntax highlighting (primarily intended for russian users though). It is crippled, because Geshi doesn't work well with UTF-8 encoded keywords. But it is best I can do. Language code is c1.<\/p>\n\n<h4>0.965<\/h4>\n\n<ul>\n<li>Localization corrected and now plugin is fully localizable. For now English and Russian languages added<\/li>\n<li>TinyMCE Files slightly rearranged<\/li>\n<li>Compatibility with other plugins using own Geshi libs added. Geshi is now loaded only if it wasn't loaded by some other plugin earlier.<\/li>\n<li>Russian localization fixed (button name is now displayed properly)<\/li>\n<li>Line height in CSS enforced to be 100% to avoid problems with some WP themes.<\/li>\n<\/ul>\n\n<h4>0.963<\/h4>\n\n<ul>\n<li>Another Unicode three-dots symbol presentation fixed<\/li>\n<\/ul>\n\n<h4>0.962<\/h4>\n\n<ul>\n<li>Another Unicode double-dashes symbol presentation fixed<\/li>\n<\/ul>\n\n<h4>0.961<\/h4>\n\n<ul>\n<li>Another Unicode quote-like symbol presentation fixed<\/li>\n<\/ul>\n\n<h4>0.96<\/h4>\n\n<ul>\n<li>Editor button UI added for convinient selecting all codesyntax tag options<\/li>\n<li>Code is now correctly trimmed preventing nasty newlines from appearing<\/li>\n<li>Bug fixed with non-latin code titles<\/li>\n<\/ul>\n\n<h4>0.94<\/h4>\n\n<ul>\n<li>css stylesheet problem with incorrect displaying short code fragments fixed. Thanks to Warun Kietduriyakul for reporting a bug.<\/li>\n<li>inove theme css stylesheet problem fixed. Thanks to Warun Kietduriyakul for reporting a bug.<\/li>\n<\/ul>\n\n<h4>0.93<\/h4>\n\n<ul>\n<li>css stylesheet path problem fixed. Thanks to Warun Kietduriyakul for reporting a bug.<\/li>\n<\/ul>\n\n<h4>0.92<\/h4>\n\n<ul>\n<li>Editor button for GUI mode fixed at last and is working ok now. I am sorry for this bug.<\/li>\n<\/ul>\n\n<h4>0.9<\/h4>\n\n<ul>\n<li>Editor button for GUI mode<\/li>\n<li>Syntax highlighting in comments<\/li>\n<li>Collapsable code area with customizable css<\/li>\n<li>New options for bbcode: title and bookmarkname<\/li>\n<\/ul>","raw_excerpt":"Plugin provides syntax highlighting for about 116 programming languages via Geshi.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/4345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=4345"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/fractalizer"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=4345"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=4345"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=4345"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=4345"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=4345"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=4345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}