CodeColorer is the plugin which allows you to insert code snippets into the post with nice syntax highlighting. I want to show you example first:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | class Feed < ActiveRecord::Base SourceTypes = { :category => 0, :tag => 1 } define_enum :source_type, :raise_on_invalid => true #------------------------------------------------- # Accessors def video_ids v = self[:video_ids] v ? v.split(':').map(&:to_i) : [] end end |
Plugin based on GeSHi library, which supports most languages. CodeColorer has various nice features:
- syntax highlighting in RSS feeds
- syntax highlighting of single line of code (inline)
- syntax highlighting of code in comments
- line numbers
- automatic links to the documentation inserting
- code block intelligent scroll detection (short code would have short block, for long one block height would be fixed and scrollbar would appear)
- predefined color themes (Slush & Poppies, Blackboard, Dawn, Mac Classic, Twitlight, Vibrant Ink)
- syntax colors customization in CSS file
- code protect from mangling by Wordpress (for example, quotes, double-dashes, etc would look just right as you entered)
Installation
-
Download and unpack plugin files to wp-content/plugins/codecolorer directory.
-
Enable CodeColorer plugin on your Plugins page in Site Admin.
-
Go to the Options/CodeColorer page in Site Admin and change plugin’s options as you wish.
-
Use
[cc lang="lang"]code[/cc]or<code lang="lang">code</code>syntax to insert code snippet into the post (you could skiplang="lang", in this case code would be in code block, but without syntax highlighting). Also you can use[cci lang="lang"]code[/cci]to format inline code (see the “inline” option description). The list of available languages you could find below. -
Have fun!
Syntax
To insert code snippet into your post (or comment) you should use [cc lang="lang"]code[/cc] or <code lang="lang">code</code> syntax. Starting from version 0.6.0 you could specify additional CodeColorer options inside [cc] tag:
1 | [cc lang="php" tab_size="2" lines="40"]// some code[/cc] |
Note: You should always use double quotes or single quotes around the parameter value. Boolean values could be passed using string true or false, on or off, number 1 or 0.
Short codes
Starting from CodeColorer 0.8.6 you can use short codes to insert code snippets. The short code in common looks like [ccMODE_LANG], where LANG is your programming language, and MODE is the one or more of following modes:
- i – inline
- e – escaped
- s – strict
- n – line_numbers
- b – no_border
- w – no_wrap
- l – no_links
Small letter means enabled, capital – disabled. Examples:
PHP code with links enabled and line numbers disabled:
1 2 3 | [cclN_php] echo "hello" [/cclN_php] |
Already escaped HTML code:
1 | [ccie_html]<html>[/ccie_html] |
Ruby code without wrapping having tab size equal to 4:
1 2 3 | [ccW_ruby tab_size="4"] attr_accessor :title [/ccW_ruby] |
More examples could be found on the CodeColorer Examples page. You can find modes explained below.
Possible parameters
- lang (string) – source language.
- tab_size (integer) – how many spaces would represent TAB symbol.
- line_numbers (boolean) – when true line numbers will be added.
- first_line (integer) – a number of the first line in the block.
- no_links (boolean) – when false keywords will be represented as links to manual.
- lines (integer) – how many lines would be block height without scroll; could be set to -1 to remove vertical scrollbar.
- width (integer or string) – block width.
- height (integer or string) – height in pixels; used when lines number is greater then “lines” value.
- rss_width (integer or string) – block width in RSS feeds.
- theme (string) – color theme (default, blackboard, dawn, mac-classic, twitlight, vibrant).
-
inline (boolean) – when true forces code block to render inside
<code></code>tag. Used to paste a single line of code into the regular text. - strict (boolean) – when true strict mode will be enabled. By default CodeColorer tries to guess whether strict mode is needed, so this option allows to force it on or off when automatic suggestion is wrong.
- nowrap (boolean) – when false no horizontal scrollbar will be shown; instead code will be wrapped in the end of code box.
- noborder (boolean) – when true no border will be shown around the code block.
-
no_cc (boolean) – when true the syntax in code block will not be highlighted, code will be rendered inside
<code></code>tag. - class (string) – additional CSS classes to add to the wrapper HTML element.
You can use special tag [cci] instead of [cc] to force inline mode: [cci lang="lang"]code[/cci]
Most of these parameters could be configured via the CodeColorer options page.
Supported languages
Here is list of supported by CodeColorer languages: abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cmake, cobol, cpp-qt, cpp, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle11, oracle8, pascal, per, perl, php-brief, php, pic16, pixelbender, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xml, xorg_conf, xpp, yaml, z80.
Requirements
Plugin works with Wordpress 2.7.0 – 2.8.2 as well. Hey users of WordPress 2.7.0, could you explain why do you use so old buggy crap? Use new one instead, at least it looks more beautiful!
Download
The latest version of the CodeColorer plugin is 0.9.7, and you can download it here:
version0.9.7DownloadCodeColorer Plugin
Also you can download older versions from plugin home page on WordPress.org (but do you really need this old stuff?).
Translations
Thank you all guys, who submitted translations to your language. CodeColorer is currently available in following languages:
- English
- Russian – Русский
- Ukrainian – Українська
- Arabic – العربية (thanks to Amine Roukh)
- Belarusian – Беларуский (thanks to И. Фадков)
- Danish – Dansk (thanks to Hans Klysner)
- Dutch – Nederlands (thanks to Martijn van Iersel)
- French – Français (thanks to Valentin PRUGNAUD, fanta78, Sylvain Zabé, and Whiler)
- German – German (Deutsch) (thanks to Fabian Schulz and Michael Gutbier)
- Hebrew – עִבְרִית (thanks to Yaron Ofer)
- Italian – Italiano (thanks to CodeSnippet)
- Japanese – 日本語 (thanks to Kuroneko Square)
- Polish – Polski (thanks to Andrzej Pindor)
- Brazilian Portuguese – Português Brasileiro (thanks to Paulo César M. Jeveaux, Fabricio Bortoluzzi, and Rodolfo Leão)
- Simplified Chinese – 简化字 (thanks to liuxiangqian)
- Spanish – Español (thanks to Sergio Díaz)
- Spanish – Español (Argentina) (thanks to Diego Sucaria)
- Spanish – Español (Colombia) (thanks to Diego Alberto Bernal)
- Swedish – Svenska (thanks to LHLI)
- Turkish – Türkçe (thanks to Hasan Akgöz)
Want to help me with translation? It’s easy!
-
Install Poedit.
-
Download codecolorer.pot file.
-
Click File/New catalog from .pot file and select codecolorer.pop you’ve just downloaded.
-
Enter project name (something like CodeColorer 0.9.1), your name and email address, select a language you want to translate to and click OK.
-
Enter a filename like codecolorer-en_EN.po and click Save.
-
Translate all strings one by one.
-
Send me a .po file with a translation to kpumuk@kpumuk.info. Do not forget a link to add to CodeColorer project home page.
-
Thank you!
To fix existing translation, just open corresponding .po file from codecolorer/languages folder in Poedit, and add missing or update existing strings.
Customization
Syntax coloring is highly customizable: you could change color scheme for all
languages or for specific language. You could find CodeColorer CSS in
wp-content/plugins/codecolorer/codecolorer.css file. To change colors for
all languages edit lines below Color scheme section.
There is simple mapping exists between Textmate color themes and CodeColorer
ones:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | /* "Slush & Poppies" color scheme (default) */ .codecolorer-container, .codecolorer { color: #000000; background-color: #F1F1F1; } /* Comment */ .codecolorer .co0, .codecolorer .co1, .codecolorer .co2, .codecolorer .co3, .codecolorer .co4, .codecolorer .coMULTI { color: #406040; font-style: italic; } /* Constant */ .codecolorer .nu0, .codecolorer .re3 { color: #0080A0; } /* String */ .codecolorer .st0, .codecolorer .st_h, .codecolorer .es0, .codecolorer .es1 { color: #C03030; } /* Entity */ .codecolorer .me1, .codecolorer .me2 { color: #0080FF; } /* Keyword */ .codecolorer .kw1, .codecolorer .kw2, .codecolorer .sy1 { color: #2060A0; } /* Storage */ .codecolorer .kw3, .codecolorer .kw4, .codecolorer .kw5, .codecolorer .re2 { color: #008080; } /* Variable */ .codecolorer .re0, .codecolorer .re1 { color: #A08000; } /* Global color */ .codecolorer .br0, .codecolorer .sy0 { color: #000000; } |
Check the codecolorer.css file to get more examples.
Frequently Asked Questions
Q. How do I can customize CodeColorer CSS rules?
A. Go to the Options/CodeColorer page in Site Admin and change the “Custom CSS Styles” option.
Q. I see < instead of < (or other HTML entities like >, &, ") in my code.
A. You should use [cc escaped="true"] or [cce] in the visual editor when inserting code into the post.
Q. Does it highlights my code on server or client side?
A. CodeColorer performs code highlighting on the server, you could see HTML of the highlighted code in page source.
Q. Is it produces valid XHTML source?
A. Yes, resulting XHTML is completely valid.
Q. Could my visitors insert their code snippets in comments?
A. Yes, CodeColorer supports code highlighting in comments using the same syntax, as you use in your blog posts.
Q. How can I disable syntax highlighting for a particular <code> block?
A. Use no_cc="true" option for your code block.
Q. I have updated the plugin to the newest version and now I keep getting following warnings:
1 | Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/wordpress/wp-content/plugins/codecolorer/lib/geshi.php on line 3599 |
A. Remove all files from wp-content/plugins/codecolorer folder and unpack an archive with plugin again (thanks to Anatoliy ‘TLK’ Kolesnick).
Q. I love this plugin. How to do a favor to the author?
A. Just vote for this plugin on WordPress.org. And thank you!
Support
If you have any suggestions, found a bug, wanted to contribute a
translation to your language, or just wanted to say “thank you”,– feel free to contact me. Promise, I will answer to every message.
If you want to contribute your code, see the Development section below.
Development
Sources of this plugin are available both in SVN and Git:
Feel free to check them out, make your changes and send me patches. Promise, I will apply every patch (of course, if they add a value to the product). Email for patches, suggestions, or bug reports: kpumuk@kpumuk.info. Also you have much more ways to contact me.
Changelog
- 0.9.7 (December 19, 2009)
- Fixed
theme="geshi"attribute bug. - Added ability to highlight arbitary piece of code from PHP.
- Use
wp_enqueue_styleinstead of echoing plain HTML. - Fixed problem with escaped code blocks, when some entities were not unescaped.
- Fixed compatibility with WordPress 2.9.
- Fixed
- 0.9.6 (December 18, 2009)
- Added French translation (thanks to Valentin PRUGNAUD, fanta78, Sylvain Zabé, and Whiler).
- Added Brazilian Portuguese translation (thanks to Paulo César M. Jeveaux, Fabricio Bortoluzzi, and Rodolfo Leão).
- Added Swedish translation (thanks to LHLI).
- Fixed XHTML validation problems on the CodeColorer options page (thanks to Brett Zamir).
- Added Japanese translation (thanks to Kuroneko Square).
- Added Danish translation (thanks to Hans Klysner).
- Added GeSHi theme.
- Added ability to specify custom CSS class for the wrapper HTML element.
- 0.9.5 (August 27, 2009)
- Added Dutch translation (thanks to Martijn van Iersel).
- Added Spanish (Argentina) translation (thanks to Diego Sucaria).
- Added Arabic translation (thanks to Amine Roukh).
- Fixed bug in Safari 4 caused by text-align=justify in parent container.
- 0.9.4 (August 24, 2009)
- Version bump to 0.9.4 (for WordPress.org).
- 0.9.3 (August 20, 2009)
- Quicktag added (replaces default code button).
- TinyMCE plugin added to insert code snippets (temporarily disabled).
- Added German translation (thanks to Fabian Schulz and Michael Gutbier).
- Added Spanish translation (thanks to Sergio Díaz).
- Added Turkish translation (thanks to Hasan Akgöz).
- Added Polish translation (thanks to Andrzej Pindor).
- Added Spanish (Colombia) translation (thanks to Diego Alberto Bernal)
- Added Hebrew translation (thanks to Yaron Ofer).
- Fixed problem with PHP 4 (thanks to Conan Chou, Алексей Таранец, Martijn van Iersel).
Complete changelog could be found on the CodeColorer History page.
Other plugins
Full list of plugins I have implemented is available here.

Есть ещё и отечественный http://softwaremaniacs.org/soft/highlight/
Ага, но он принципиально отличается тем, что реализован на JavaScript и раскрашивает синтаксис на клиенте. Хотя признаю, решение красивое :-)
Несколько неудобным показалось то, что само “окошко” фиксированной высоты. я о тех случаях когда надо написать буквально пару строчек кода.
Можно было бы реализовать через min-height(expression для ИЕ) + overflow:hidden…немного гармонии так сказать ;)
Хм… для пары строчек высота блока не фиксируется. Вот пример:
2
echo $a . ' world';
Фиксируется только для блоков кода, высота которых больше заданной в настройках.
Упс,прошу прощения. Зачит, трабл с плагином где-то у меня.
[...] Já no meu primeiro post tive essa dificuldade, tudo bem.. tem a tag <pre> ou até mesmo o CODE do WP, mas fala sério né.. sem nenhuma classe! Então navegando por ae, achei um plugin excelente que se chama CodeColorer. [...]
[...] CodeColorer — Плагин на библиотеке GeSHi (Generic Syntax Highlighter), поддерживающей несметное количество языков (71, если быть точным). Плагин прост в установке и настройке. Вот пример работы этого плагина: [...]
Отличный плагин! Большое спасибо!
Установил. Запостил статью с блоками:
и
Вместо этого текста при просмотре сайта отображается:
::CODECOLORER_BLOCK_1::
::CODECOLORER_BLOCK_2::
В чем дело?
А какая у вас версия плагина и вордпресса? И используете ли вы визуальный редактор?
Стоял Wordpress 2.1.0 Русская версия с сайта maxsite.org
Плагин качал с Вас вчера.
Но уже там появилась 2.2.0 – с ней все ок.
Ну а с 2.1.0. разберитесь.
Да и еще. Для подсветки синтаксиса конфигурационных файлов (apache, mysql, proftpd), чему лучше приравнивать параметр lang ?
Еще замечание:
при вставке кода между тегами
[cc][/cc]
треугольных скобок они некорректно отображается :-(
Mad Chicken: Большое спасибо за отзывы. Отвечу по порядку.
2.1.0 посмотрю, неожиданно как-то в нем сломалось.
Для подсветки кофигурационных файлов Apache язык apache, для конфига MySQL (если не ошибаюсь) подойдет ini, для самих запросов — mysql (либо просто sql, но тогда некоторые специфические для мускула вещи не подсветятся). Вот насчет ProFTPD — не знаю, возможно apache подсветит и его, уж больно похожи.
Насчет угловых скобок — это второй вопрос в секции ЧаВО чуть выше на странице. Съедает их вордпресс во время постинга в визуальном редакторе. Советую на время вставки примеров кода переключаться в редактор HTML (или вообще не использовать визуальный редактор ибо он от лукавого, постоянно лепит непонятные теги, причем не к месту).
Еще раз спасибо.
Мне кажется что проблему с угловыми скобками можно решить в самом плагине, например производить замену < на нужный символ. К тому же угловые скобки часто встречаются в конфигурационных файлах апача, Mysql итд. Ведь даже если в 1й раз переключишся в режим редактирования кода html, то при следующем редактировании статьи – оптять косяки вылезут.
Имхо можно решить проблему.
Я над этим работаю. Просто до этого времени основной задачей было исправить проблемы с XHTML и проблемами в комментариях. Сейчас образовалось немного времени на исправление этой багофичи вордпресса.
Подскажите, пожалуйста, как выделить код прямо в строке, без переноса, так, как у вас сделано на сером фоне с пунктиром?
У меня это сделано без CodeColorer, просто тег <tt>code</tt>, и в стилях поставил фон этому тегу. А за мысль спасибо, надо добавить в CodeColorer.
Ясненько.
Спасибо за этот плагин! Очень удобная штука.
Дмитрий, еще такой вопрос.
Если код состоит всего из одной строки и он меньше ширины страницы, т.е. не появляется горизонтальный скролл, то под этой строкой появляется отступ, который “забронирован” для скролла.
Не очень красиво это выглядит. Можно как-то исправить?
I’m also getting ::CODECOLORER_BLOCK_1::. Using Wordpress 2.1 without the visual editor. Could you translate your response to Mad Chicken? Thanks!
[...] CodeColorer color your programming posts [...]
I am having a few problems with CodeColorer. First off, it seems that no matter what or where I set the tab_length to it equals 4. Also, if I post some code, and then go to edit it later, all of the tabs disappear. Is there any way that the CodeColorer could automatically insert tabs where it makes sense?
[...] CodeColorer [...]
[...] Visit [...]
Hi, I have a little (but horrible) problem with this plugin in my theme.
I use Freshy theme (http://www.jide.fr/) and line numbers appears in wrong mode. Like this:
1
First line of code
2
Second line of code
….
How can I correct this?
Thanks
2
3
echo $awesome . "rocks!!";
[...] Plugin – CodeColorer http://kpumuk.info/projects/wordpress-plugins/codecolorer [...]
[...] Отказался от плагина colorer в пользу Highlight. Оба плагина занимаются подсветкой [...]
Here my test :
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
stage.align = StageAlign.TOP_LEFT;
var myLoader:Loader = new Loader();
addChild(myLoader);
myLoader.load(new URLRequest('zoom_4-5.jpg'));
myLoader.contentLoaderInfo.addEventListener(Event.INIT, initListener);
function initListener(e:Event):void {
Bitmap(myLoader.content).smoothing = true;
stage.addEventListener(Event.RESIZE, resizeListener);
}
function resizeListener(e:Event):void {
var scale_x = stage.stageWidth/1219;
var scale_y = stage.stageHeight/609;
var scale_global:Number;
if(scale_x > scale_y) {
scale_global = scale_y;
}
else {
scale_global = scale_x;
}
myLoader.scaleX = scale_global;
myLoader.scaleY = scale_global;
}
[...] Я использую Сагалаевский highlight.js. Есть еще CodeColorer от kpumuk’а и, думаю, еще куча разных плагинов в этой [...]
[...] I am posting this script at such an early stage because I wanted to test a Highlight Syntax plug-in for wordpress. Thanks to CodeColorer (http://kpumuk.info/projects/wordpress-plugins/codecolorer). [...]
Спасибо, очень удобный плагин, а то <code> как-то не очень удобен для вставки кода.
P.S. OpenID(Oher OpenID) не работает – ругается на curl_init, проверь…
Exist a client side (javascript) version of this plugin???
[...] sahip kod renklendirici arayan arkadaşlar buyrun karşınızda CodeColorer. Bu yazının orjinaline buradan ulaşabilirsiniz. Ben sadece yazıyı dilim döndüğünce affınıza sığınarak çevirmiş [...]
Спасибо огромное за плагин!
Всё отлично, но поддержу Mad Chicken в его просьбе решить проблему с угловыми скобками. Посчу много шел скриптов – а там угловые скобки чуть не в каждой строчке. Переправлять каждый раз когда вносишь изменение в пост утомляет.
Ещё раз спасибо за плагин! )
Thanks for this one! Installed… works like charm.
Спасибо за хороший плагин. Но у меня с ним тоже возникла проблема. При написании сообщения всё нормально сохраняется и выглядит в блоге. Но когда я решаю отредактировать написанный пост – то вместо нормального кода в редакторе вордпресса я вижу уже не то, что надо (например, если у меня был в коде тэг , то в редакторе его нет, просто переход на новую строку). И при повторном сохранении код уже портится. Что делать?
Тэг “br” я имел в виду, вордпресс и тут вырезал его из коммента. :)
[...] sahip kod renklendirici arayan arkadaşlar buyrun karşınızda CodeColorer. Bu yazının orjinaline buradan ulaşabilirsiniz. Ben sadece yazıyı dilim döndüğünce affınıza sığınarak çevirmiş [...]
[...] codecolorer благин с более обширным спектором возможностей: нумерация строк автоматическая вставка ссылок на документацию вычисление размера блока кода (короткий код будет заключен в маленький блок, для более длинного высота блока будет зафиксирована, и появятся полосы прокрутки) настройка стиля блока кода в Site Admin (Панель управления) настройка подсветки синтаксиса в файле CSS подсветка кода в комментариях защита кода от искажения Wordpress’ом (например, двойные кавычки, длинные тире и т.п. будут выглядеть в точности так, как Вы их ввели) [...]
[...] beberapa macam syntax hiliter yang saya cari di WordPress Plugins saya tertarik dengan codecolorer, karena sangat simpel dan mudah digunakan. Awalnya saya agak jengkel dengan plugin ini. Sebab kode [...]
[...] I have had poor results with Flash Text Formatter I no longer use it. Rather I suggest CodeColorer. Flash Text Formatter suffers from a lack of maintenance and good web site [...]
Hi, I’ve been tested this script and it show me an line with error when I activated on Plugin’s Area (WordPress 2.3.3).
Error:
Is it normal?
Hi Raphael,
Looks like you have enabled another syntax highlighting plugin that uses GeSHi framework too. You must disable it before using CodeColorer.
Hum, I will see.
Thanks! :)
после активации плагина вкладка “плагины” админки wordpress не открывается, сносишь плагин по FTP все сразу нормально. Странный баг какой-то
[...] CodeColorer [...]
у меня почему то при активации плагина выскакивает ошибка в коде с блогом
GeSHi Error: GeSHi could not find the language lang (using path /home/domain/domains/my_domain.com/public_html/wp-content/plugins/codecolorer/lib/geshi/)
[...] плагином под названием CodeColorer вы можете ознакомится тут. Очень даже удобный. Его плюс, имхо, в том что он [...]
[...] 其實可以搭配另一個外掛,那就是 CodeColorer,這個外掛,可以讓你在寫程式的時候加上顏色喔,相當方便,他支援的語法如下: actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, caddcl, cadlisp, cfdg, cfm, cpp-qt, cpp, csharp, css-gen.cfg, css, c_mac, d, delphi, diff, div, dos, eiffel, fortran, freebasic, gml, groovy, html, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, matlab, mirc, mpasm, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, perl, php-brief, php, plsql, python, qbasic, rails, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, xpp, z80 [...]
Большое спасибо, это действительно то что я искал, очень удобно и без лишнего гемора, особенно когда публикуешь фрагменты кода
I have to say ‘Thank you’ first, I loooooooove this plugin!!!!
One small thing, I notice the code will remove the first spaces from the code because of ‘trim’, I use the following code instead and it fixed the problem.
p.s. it works fine with wp2.5.1
2
3
$text = rtrim($text);
#line 215 $text = trim($text);
Yep, you can use :-)
I think I found a small bug
in comment if wrote several \ and a ' in the cc or code block, that comment won’t be posted!
if in post wrote several \ and a ' the result will be missing one \
I make a small change
2
# $text = str_replace(array("\\\"", '\\''), array ("\"", '\''), $text);
[...] Спасибо Dimox‘у за линк на клевый плагин для подсветки и форматирования кода в вордпрессе. [...]
[...] один плагин WordPress для подсветки синтаксиса — CodeColorer. Как и многие другие плагины (напрмер, WP CodeBox Эрика [...]
[...] jolies couleurs plus haut, c’est CodeColorer. Neat [...]
[...] que nada estaba utilizando el plugin de codecolorer hay que buscar el archivo codecolorer.php y modificar algunas [...]
[...] | Author: Dmytro Shteflyuk Coloring: #8 of 8 Ease of Install/Use: #8 of 8 Line Numbers: Optional PRE or CODE: CODE or [...]
[...] CodeColorer обладает также рядом дополнительных интересных свойств, например, нумерацией строк, настройкой подсветки синтаксиса, подсветкой кода в комментариях и т.п. Модуль имеет достаточно широкий спектр настроек и большой список поддерживаемых языков. Единственное, что заставляет задуматься, это требования к версии wordpress – 2.1. Поэтому гарантии безотказной работы в более старших версиях нет. Подробнее о плагине на русском языке можете почитать в этом обзоре. [...]
I think I found 2 bugs.
1. If code snippets has only one line, his height is to small to display code.
2. If there are some tabs in code I must to use parameter ‘tab_size’. Is there no default value?
Upsss. Here one line snippet looks properly. Why?
[...] 5) CodeColorer [...]
[...] CodeColorer обладает также рядом дополнительных интересных свойств, например, нумерацией строк, настройкой подсветки синтаксиса, подсветкой кода в комментариях и т.п. Модуль имеет достаточно широкий спектр настроек и большой список поддерживаемых языков. Единственное, что заставляет задуматься, это требования к версии wordpress – 2.1. Поэтому гарантии безотказной работы в более старших версиях нет. Подробнее о плагине на русском языке можете почитать в этом обзоре. [...]
[...] Для подсветки синтаксиса установил плагин для WordPress - CodeColorer. Плагин поддерживает кучу языков: actionscript, ada, apache, [...]
[...] мы пользовались плагином CodeColorer : отличный плагин на основе GeSHi для подсветки исходных [...]
[...] opierając się na opisach i ocenach postanowiłam wypróbować wtyczkę CodeColorer którą stworzył Dmytro Shteflyuk. Oczywiście nie twierdzę, że jest ona najlepsza, ale z [...]
[...] 2. CodeColorer Plugin works with Wordpress 1.5 and 2.0/2.1 as well. Recommended to update your Wordpress to version 2.1 because it has many nice features. http://kpumuk.info/projects/wordpress-plugins/codecolorer/ [...]
[...] CodeColorer [...]
test highligh
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
SourceTypes = {
:category => 0,
:tag => 1
}
define_enum :source_type, :raise_on_invalid => true
#-------------------------------------------------
# Accessors
def video_ids
v = self[:video_ids]
v ? v.split(':').map(&:to_i) : []
end
end
In SVN version of Wordpress 2.8 (bleeding edge) the options page doesn’t load, just an FYI. I am not sure if it’s something you will need to change for 2.8 or a problem with wordpress guys created in the trunk by accident with loading the plugin options. If I find out I will let you know. ‘Cannot load codecolorer-options.php.’
It looks like the path changed slightly to:
Instead of
Hi there, thanks for the plugin…is the best of its kind so far. I have a question, it’s kind of dumb so please be gentile. I want to show some code but i have no idea what language is it…it’s some kind of C# but i am not shure. Is there a way to use in the code section something like “all”? Thanks:)
very good !
Thanks!
2
3
<mx:Button id="rang" />
</mx:Application>
Good
thx!
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Pre-2.6 compatibility
if( !defined('WP_CONTENT_DIR') )
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
if( !include( WP_CONTENT_DIR . '/wp-cache-config.php' ) )
return;
if( !defined( 'WPCACHEHOME' ) )
define('WPCACHEHOME', dirname(__FILE__).'/');
include( WPCACHEHOME . 'wp-cache-base.php');
if(defined('DOING_CRON')) {
require_once( WPCACHEHOME . 'wp-cache-phase2.php');
return;
}
$mutex_filename = 'wp_cache_mutex.lock';
$new_cache = false;
// Don't change variables behind this point
$plugins = glob( WPCACHEHOME . 'plugins/*.php' );
if( is_array( $plugins ) ) {
foreach ( $plugins as $plugin ) {
if( is_file( $plugin ) )
require_once( $plugin );
}
Тест!
When I try to change the options in WP2.7 (Cutline theme) the page goes into an infinite loop, I can only get out of it by moving the plugin directory. Any ideas?
Are there any options to disable plugin action for marked elements? I mean sth like this: “code lang=”false”. I hope you get it :)
2dreame4: Will add this feature in next version (will be released at the end of this week).
Огромное спасибо! Теперь при цитировании скриптов всё стало так аккуратно и красиво! :)
@Dmytro Shteflyuk: great information ;) And I noticed that there is a problem with validation your plugin. I mean converted <code&rt; is not validated. Do you take care of it?
Thank you again! Just committed a fix for this problem.
2 dreame4: Just released CodeColorer v0.7.3 with new option:
First – thanks for a great plugin!!
I have a minor feature request. Instead of specifying the width in pixels, I prefer to specify it in %, as my blog is not fixed width. This used to work in a previous version, but now it seems that px is hard-coded in.
Thanks.
Rob
Look at this page: http://wordpress.sundskard.dk/archives/119
The code is not highlighted correctly.
2 Andrias: looks like you forgot to add opening <php tag at the beginning of the code block.
Yes I know, but that is actually intentional. The code that I show is meant to be “copy and paste” code, and I don’t want any tags at the end.
Ok, I see the problem. In current version you should add opening tag at the beginning of the code. I will try to figure out this limitation in future releases. Thank you for your feedback!
Hey Robert,
Your suggestion makes sense, will take a look at this problem in nearest release.
Hi,
I seem to be having trouble, nothing shows up – the html code is there (view source) but there is nothing being shown. Just a grey bar… any ideas?
Kevin
Hey Kevin,
Looks like a link to your source was stripped out. Could you re-post it?
Thanks Dmytro for the nice plugin.
Is there a way to change the font family?
I have tried changing the font-family property in the .codecolorer-container * selector, but it seems that the default font-family (Monaco, Lucida Console, monospace) is applied automatically and directly to the codecolorer div. The result is that some of the code (anything outside a span) is displayed using the default font-family, and the rest is displayed using the one I want.
Maybe there is a better way to do it, but I can’t figure it out.
Funktiu addContainer bila bi lutshe wot tak (potomutshto u menja Problememi s CSS autowidth):
2
3
4
5
6
7
8
9
10
11
12
13
$style = 'style="overflow:auto;white-space:nowrap';
if( $options['width'] > 0 ) {
$style .= ';width:' . $options['width'] . 'px';
}
if($num_lines > $options['lines'] && $options['lines'] > 0) {
$style .= ';height:' . $options['height'] . 'px';
}
$style .= '"';
$result = '<div class="codecolorer-container ' . $options['lang'] . ' ' . $options['theme'] . '" ' . $style . '>' . $html . '</div>';
return $result;
}
Hi Dmytro,
I like CodeColorer very much…a big up for your work. Today I implemented a nifty view toggler utilizing JQuery. Take a look at http://wordpress.org/support/topic/246260?replies=1 where everything further can found. Maybe a potential feature in one of the future releases?
Best regards from germany,
:peter
How would I reduce the font size for the entire code block including line numbers. I’ve tried per class customization (as above), but that seems to leave some keywords/classes untouched or the code isn’t alligned with the line numbers.
Is there a master css class or set that will include everything?
Hi,
I really like your plugin, but i need it to get working within the simple:press forum (http://simplepressforum.com) because i would give visitors the opportunity to post colored code.
How can i do this?
Thank you!
Great little plug-in, miles better than any of the other code highlighters I’ve experimented with.
One thing though, for some reason it wouldn’t pick up any of the CSS styling until I copied the codecolorer.css file to my theme’s directory and put in a link in my header.php to it.
Привет. Ставлю твой плагин, активирую и белая страница, делю плагин из папки все гуд, что не так? вордпресс 2.7.1 русский.
I have as similar issue as Kevin, nothing shows up while the html source seems valid.
This is what I am trying to display:
2
3
''' This is a test function '''
print "Testing ..."
Could it be possible that my theme is somehow overwridding the css used for displaying the code?
Tested with default themes and still a no go!
What are the chances that you can make the output visual retranslate the < and %gt; back into > and doesnt output translated, see this post:
http://frumph.webcomicplanet.com/code-snippets/wordpress/adding-multi-user-php-free-chat-into-wpmu/
2
3
4
5
6
7
8
9
10
11
12
13
14
:born => '2008-06-09 18:22:00 EDT',
:weight => {:lbs => 6, :oz => 8},
:length => {:inches => 21.25})
skoglunds.children << piper
piper.daily do |p|
8.times do
p.eat
p.poop
p.sleep
end
end
У меня подсветка Java кода отображается некорректно после символа @ в коде. Посмотрим, как у вас.
2
3
4
5
6
@Override
public String toString() {
return "Test";
}
}
Добрый день.
Есть предложение насчет улучшения плагина.
Итак хотелось бы получить такой же функционал как и в этом плагине syntaxhighlighter-plus. Т. е. менюшки сверху и такуюже тему оформления defaut.
Насчет дополнения функционала можно просто скрестить 2 плагина – так получатся менюшки.
А как перенести тему defaut в CSS еще не знаю.
Great plug-in, really useful. Can I add a vote for width to be specified in percentage? If I make it look just right on the PC, mobile browsers have heart attacks ;)
In codecolorer.php I would change
2
3
echo '<link rel="stylesheet" href="' . get_option('siteurl') . $this->pluginLocation . 'styles.php" type="text/css" />', "\n";
}
to
2
3
4
5
6
if (trim(get_option('codecolorer_css_style'))!='')
echo '<link rel="stylesheet" href="' . get_option('siteurl') . $this->pluginLocation . 'styles.php" type="text/css" />', "\n";
else
echo '<link rel="stylesheet" href="' . get_option('siteurl') . $this->pluginLocation . 'codecolorer.css" type="text/css" />', "\n";
}
because that way, the STYLES.PHP is only called if its really necessary.
And if I were you I wouldn’t store the additional CSS in the options at all but in an additional CSS-files because your “styles.php” requires “wp-load.php” and this takes a long time to load. And this only happens because you need the getoption-function.
Thank you very much for this beautyful plugin!
I’m getting it to work really fine in wordpress. With enthusiasm!
Some small observations:
Setting the tabsize to less than 4 in the options panel doesn’t seem to change it, it still shows “4″ after a submit change and reload.
Then I think the stules for xml in the default theme write:
.twitlight .xml .re1 { color: #008080; }
/* Constant */
.twitlight .xml .re0 { color: #0080A0; }
– the exact same as in the twitlight theme.
Then actionscript3 misses the ‘extend’ method. I’ve written a comment on the SELD BE blog about it.
Any chance the themes not used could be ommitted in the loaded documents? It seems like a lot of css to load, then to override..
But this is fun and your plugin is wonderful!
regards and thanks
Kamilla
I’m using your plugin, and noticed that it only ever seems to work on my single post pages and not the index:
Here’s an example of the single page:
http://s1n.dyndns.org/index.php/2009/05/14/more-sub-confusion/
See my main index for an example where it’s not applying the style:
http://s1n.dyndns.org
Any ideas?
hi, I’m simaopig.
I want know how i can set the keyword link open in new tab or new window?
Hope your mail. Thank you!
2
3
4
5
6
7
8
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
2
3
4
5
6
7
8
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
2
3
4
5
6
7
8
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
2
3
4
5
6
7
8
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
Hi there,
Was wondering if you could just make one small fix to your very useful plugin–
Change line 135 of codecolorer.php to:
Then add to codecolorer.css:
Or something semantically named like “line-numbering”.
I’m a bit of a nut of separating formatting from structure, even if it is not 100% clear yet on whether HTML5 will remove the cellpadding and cellspacing attributes (since the spec is still in draft), I still think it’s a good practice to follow it.
And this is just an idea but, although there are no namespaces in CSS, I wonder whether using “:” or “.” in the class name might help ensure that there were no collisions when including another CSS library. Of course, that’d be more work, but just an idea. Maybe prefix the attributes with “cc:” or something?
Thank you!
Sorry, I of course meant prefix the class attribute values, not the attribute (name).
hey there -
thanks for the plugin! a quick question – how do you add a “TAB symbol?”
much appreciated.
I went to activate this plug in and my entire blog and admin went down.
After updating to Wordpress 2.8.1 i can’t access the options-page of codecolorer. Could you fix that?
After updating the plugins i have any problem… you can see, for exaple, this page http://codesnippet.altervista.org/scaricare-sorgente-di-una-pagina-in-c/ . Your plugins is very cool, i hope can you fix this problem. For all style have this problem…
Good job.
(sorry for bad english)
To codesnippet: sorry for this weird problem. Fixed in 0.8.1 (already on wordpress.org and will be available using automatic update very soon). Thank you for report.
Dmytro Shteflyuk, thank you for this plugins and thank for fix the problem.
Sorry for my double post.. i found other problem… in rss feeds i see code correcly only IE but Firefox and Opera have some problem to interpret it. Is problem for firefox and Opera or is problem the script?
an other one problem, i don’t know, but, now, i can’t set the height for block.. the block of code is equal to lines of code.. and not is equal at pixel can i set on administration panel. For example, before, in this page (http://codesnippet.altervista.org/conto-alla-rovescia-in-javascript/) i have the vertical scrool.. now, for only value in the height box, i see all code.
Thank you e sorry again for my english..
sorry again for triple post :D . I can traslate your script in italian language if is not problem for you.. tell me.. ;)
————–
To codesnippet: height problem has been fixed in version 0.8.2, which will be pushed out later today (or tomorrow). Italian translation would be really great!
I’ve update it to 0.8 ,but i didn’t see style.php in my plugin.
So it didn’t work right,and i use the old version now..
There is no need for styles.php now, because it really slows down the whole site. Instead plain old CSS file + a little of custom CSS in page head will be used. Hope you will appreciate it.
Also make sure you are installed 0.8.1 since 0.8.0 has weird bug with styles inclusion.
Dmytro Shteflyuk ok. I send on you email the tralation of script.
In the last version compare two warning when i paste php code
2
3
Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 3 in /membri/codesnippet/wp-content/plugins/codecolorer/lib/geshi.php on line 2132
Which version of PHP do you use? Looks like latest GeSHi has a problem with old PHP releases.
Ok. I have read the geshi source sode…
2
preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i))
this is the interested line..
Not is an problem the script.. but my hosting using a version of PHP < 4.3.0.
Looks like the easiest way for you to fix this error is to replace following lines in lib/geshi/php.php:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"(?>[^\"'?\\/<]+)|".
"\\?(?!>)|".
"(?>'(?>[^'\\\\]|\\\'|\\\\\\\|\\\\)*')|".
"(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
"(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
"\\/\\/(?>.*?$)|".
"\\/(?=[^*\\/])|".
"<(?!<<)|".
"<<<(?<phpdoc>\w+)\s.*?\s\k<phpdoc>".
")*(?<end>\\?>|\Z)/sm",
5 => "/(?<start><%)(?:".
"(?>[^\"'%\\/<]+)|".
"%(?!>)|".
"(?>'(?>[^'\\\\]|\\\'|\\\\\\\|\\\\)*')|".
"(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
"(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
"\\/\\/(?>.*?$)|".
"\\/(?=[^*\\/])|".
"<(?!<<)|".
"<<<(?<phpdoc>\w+)\s.*?\s\k<phpdoc>".
")*(?<end>%>)/sm",
with these:
2
5 => "/(<%)(?:'(?:[^'\\\\]|\\\\.)*?'|\"(?:[^\"\\\\]|\\\\.)*?\"|\/\*(?!\*\/).*?\*\/|.)*?(%>|\Z)/sm"
Ok.. i used for fix the problem. Thanks ;)
something wrong with latest version, the “disable showing lines” doesn’t work!
Shame on me! Releasing 0.8.4. Too many releases in two days :-)
Do you know ? The new version for mysql is wrong.
The Link is wrong ,and the code is not right.
You can test.
By the way , I like it ,So I hope it wonderful.Thank you.
2
3
4
5
6
7
8
创建一个qq表,将qq_id设为主键,且没有对其进行NOT NULl约束
*/
create table qq(
qq_id int(10),
nick_name varchar(255) not null,
primary key (qq_id)
)
Ah ha, I know ,if use the link to the mySql doc ,it’s wrong..
You can test..EN..
I see, thank you!
Not at all, hope your new version.
Sorry, my english is poor..(*^__^*) ……
Hi Dmytro,
I found a bug in the latest version. In codecolorer-options.php, the following line:
As you can see, its updating the ‘codecolorer_tab_SITE’ variable in the database instead of the ‘codecolorer_tab_SIZE’ variable. This makes it impossible to edit the default tab size in the codecolorer settings unless you manually edit the database entry. :-)
Oh I forgot to tell you thank you for the great library Dmytro! Its clearly the best syntax highlighter out there for WP.
Thank you for your feedback, Marc
>Исправлена проблема, блокирующая доступ к странице
>настроек CodeColorer в WordPress 2.8.1.
Подскажи как исправил?
> Добавлена возможность задавать высоту и ширину блока в
> пикселях, em, процентах.
Огромное спасибо!
Думаю, стоит добавить параметр:
* Минимальное количество строк для активации “показа номера строк”
А то когда 1-3 строки, то выводить номер строки как-то не актуально…
2adw0rd: В WordPress 2.8 переработали систему безопасности, и теперь добавлять страницы настроек можно только из action’а admin_menu (раньше работало и из admin_init).
А насчет отключения номеров строк — с новыми короткими кодами, имхо, проблема разрешилась сама собой.
Про короткие коды пока что можно почитать здесь, завтра обновлю эту страницу (и переведу на русский).
ЗЫ. В ближайшие дни готовится масштабное обновление (сильно переписан движок и исправлена туча мелких ошибок).
Спасибо!
Я юзаю включение номера строк так:
line_numbers="true"и меня устраивает :)Just a simple question:
How can I define the fontstyle, such as size and face?
Thanks for your reply.
Jürgen
Слушай, я думаю необходимо исключать подгрузку всех css-стилей, когда нужен только один.
/wp-content/plugins/codecolorer/codecolorer.css
Очень хороший плагин, спасибо.
Но у меня недавно возникла проблема… вместо подсвеченного кода появилась строка ::CODECOLORER_BLOCK_1::… до вчерашнего дня было все нормально… обновился и появился этот текст.
Версия WP – 2.8.2–ru
Hi,
Is it possible to set a default language? Or would it be possible to make it such that a [cc] tag remembers the settings from the previous [cc] tag on the same page so we just have to define it somewhere once?
Hallo,
is that the answer for my question?
I’m so sorry, i can’t understand any of your russian??? language.
OK, maybe you mean, I have to edit the codecolorer.css.
Can you give me some hints where in the Codecolorer.css-file i have to edit.
Thanks Jürgen
Hi,
all I get from CodeColorer is this one line:
::CODECOLORER_BLOCK_1::
The actual code is not printed; looks pretty much like comment #9 from Mad Chicken. I am using CodeColorer 0.9.2 on WP 2.8.3. Any idea?
Thanks in advance
Thomas
The plugins doesn’t work as expected in WordPress-mu… don’t know if missconfiguration or what, but the editor everytime I try to add code (pasted or by keyboard), translates the special characters like < or " to entities… and the result page is showed with the entities…
I send you polish translation of CodeColorer – let me know if everything is ok.
If you get this ::CODECOLORER_BLOCK_1::, you must use PHP 5 on MediaTemple servers…
Привет.
что то не могу разобраться с tab. как его вставить в визуальный редактор? вставляю код из VS2008 , там точно таб стоит перед строкой. но при сохранении и табы и пробелы удаляются. wp 2.84
хотя, это кажется глюк оперы и tinymce
в ie все отлично
Hey, thanks for the nice plugin, but it looks like CodeColorer is broken for wordpress 2.8.4 At least all I’m getting is ::CODECOLORER_BLOCK_1:: where I expect a snippet of code.
Is this a known problem?
i would like to know if you would address this error which for the mysql link is wrong??
3Q.
Concerning the error message ‘compilation failed…’ using PHP < 4.3.3 you need an older version of Geshi (1.0.6 seems to work)
Dmytro, thanks again for being so responsive to my problem. The latest update works great now, as you can see from my latest blog post: http://www.helixsoft.nl/blog/?p=153
First of all, love the plugin, just one ‘request’ allow us to specify the starting line number with the CC tag.
i.e.
2
3
4
$changeme = 1;
$butnotme = 2;
?>
You should change line 2 not line 3
Change this
You can do it using
first_lineoption:Hi! First of all, thanks for the great plugin. I’ve just got one problem with it: no matter what I do, Wordpress seems to be stripping the spaces from the start of each line of my code, so that:
class Foo {
function bar() { }
function baz() { }
function quux() {
doFoo();
}
}
comes out as:
class Foo {
function bar() { }
function baz() { }
function quux() {
doFoo();
}
}
The only way around this seems to be to use a tag, but this then messes up the formatting. What should I do?
@Buzz: There is already support to do that: see the “first_line” parameter.
Well this went wrong here too. Let me try again:
2
3
4
5
6
7
function bar() { }
function baz() { }
function quux() {
doFoo();
}
}
is what I intend, but:
2
3
4
5
6
7
function bar() { }
function baz() { }
function quux() {
doFoo();
}
}
is the output I get (when using the visual editor and either the “cc_php” or “cce_php” shortcodes.
Any advice on using CodeColorer with the TinyMCE Advanced visual editor?
Seems that I get either my code right, or my paragraphs right… but not both.
I saw you had a TinyMCE plugin, but have revoked it, any thoughts on re-entering it into the codebase?
BTW:
Yep, TinyMCE editor is a big problem for now. I’ve started working on a TinyMCE plugin for CodeColorer, but this functionality has been disabled due to weird bugs in markup produced by rich editor. Hope, it will be fixed
I’m so sorry .
But i didn’t see the answer of the question “mysql link wrong” ..
This is the best code highlighter plugin of all. Just voted for the plugin at wordpress.org. My highest appreciation to you my friend. Thanks a lot for this plugin.
[...] CodeColorer [...]
[...] Descarga | Wordpress.com Web oficial | CodeColorer [...]
[...] Code Colorer for nice and clear code snippets. [...]
[...] 2009, under Uncategorized Just found and installed the CodeColour plugin by Dmytro Shteflyuk (See here and (no I’ve no idea how to pronounce his name either ). It’s easy to find in the [...]
Thanks for the wonderful add-in.
I’m having a little problem. When I’m checkin the post page, the add-in works fine. However, I’m having problems on my main page where the cc blocks appear instead.
Also, I tried us the VB language and the comment don’t seem to be recognized.
Sébastien
[...] на codecolorer. Прочесть об этом плагине рекомендую на странице автора. В общем пока остановился на этом плагине, так [...]
Is this plugin supported on this website. If so I need some solutions to two issues.
1. When I use
<code>it removes my text from my page.2. When I set a theme I still get no colors on the code on my page.
Thanks in advance.
Try again.
1. When I use
no_cc="true"my text is removed from my page.Добрый день, подскажите как то можно сделать чтобы когда человек вводит
{code lang=”"}тут текст{code} (специально заменил)
не вылазила ошибка, вот такая:
У меня стоит последняя 0.9.7 версия, версия WordPress 2.7.1
странно у вас не появилась ошибка, у меня пишет:
Hi. There is a problem in your code that appear when yout set an image as background. To verify that creates a “stripe” image (www.stripegenerator.com) and add it as background (in codecolorer.css ) and you will see a continuity break (set the width as 100% in the plugin options). I searched in the code and I saw that the cause is the way that you show the line numbers. You calculate the numbers manually and create a table to show them. So there is a conflict between the end of the table and the rest of the container that you create to apply the user options. I solved in two ways. The simplest is to put a width=”100%” in your second , so the table will fill all the container space.
The second is to use the Geshi methods to show the lines:
2
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
deleting the creation of the table.
thanks.
I don’t like Geshi line numbers because when you copy code, browser copies them too. It’s really weird thing, so I ended up with this table implementation. Your point about 100% makes sense, I’ll take a look how it will impact code blocks layout.