create new tag
, view all tags

DpSyntaxHighlighterPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on DpSyntaxHighlighterPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please file bug reports in the DpSyntaxHighlighterPlugin bug database.

For Bugs concerning the plugin, please report on the Bugs Web.
For Bugs concerning the highlighter, please report on syntax highlighters Google Code page.

DpSyntaxHighlighterPlugin Discussion

Known Issue

ALERT! NOTE: If you are finding <p /> tags mixed in with the source code when using a textarea, then you will need TWiki 4.2 or above. This is a problem due to Bugs:Item3757, which affects all textareas. You should still be able to use this plugin with pre.

Additional Languages

The highlighting for each language is defined in a fairly simple Brush. To create additional languages, look at the other brushes and create your own. The uncompressed versions of the brushes can be downloaded from the projects home page on Google Code. Please contribute new brushes back to the project, rather then on here.

It would be nice to have a Perl brush, since TWiki is written in Perl smile

-- AndrewRJones - 06 Jun 2007

Thanks Andrew for sharing yet another plugin with the TWikiCommunity!

How about measuring and documenting the PluginBenchmarks? See Plugin Info table in NewPluginTemplate.

-- PeterThoeny - 06 Jun 2007

Bug found. Please see: Item4460

-- AndreyTkachenko - 15 Aug 2007

file is absents in installation package /pub/TWiki/DpSyntaxHighlighterPlugin/screenshot.png

-- AndreyTkachenko - 16 Aug 2007


.dp-highlighter .tools 
   text-align1: right;

-- AndreyTkachenko - 16 Aug 2007

better code like this

sub commonTagsHandler {

    unless (!$doScript)
   my $script = "<script language='javascript'>"  
                   . "dp.SyntaxHighlighter.ClipboardSwf = '$rootDir/Scripts/clipboard.swf';"
              . "dp.SyntaxHighlighter.HighlightAll('code');"  
                   . "</script>";

   $_[0] =~ s|</body>.*?|$script$&|o;

    $_[0] =~ s/%CODE{(.*?)}%\n(.*?)%ENDCODE%/&_handleTag/egs;


# adds the script at the bottom of the
# page to get it all working
sub afterCommonTagsHandler {


-- AndreyTkachenko - 16 Aug 2007

Thanks Andrey for the bug and the feedback. Unfortunately, I don't have the time at the moment to fix this as I will be moving back to uni and have got other work to do, but will try to come back to this in a couple of weeks.

In the meantime, anyone is more than welcome to pick this up, commit the changes to SVN and release a new version.

-- AndrewRJones - 16 Aug 2007

A new version has been uploaded, with the new 1.5.1 version of the dp.SyntaxHighlighter and the bug fix.

-- AndrewRJones - 28 Aug 2007

Is it possible to have parts of the code in bold using this plug-in?

-- JonathanDorling - 22 Nov 2007

It's a brilliant plug-in. I like the fact that it's all client side javascript text highlighting and takes up minimal CPU cycles on the server side.

One remark though, the plug-in syntax parser is a bit fussy. If you add a single space character after the %CODE% it fails to parse it.

-- StephaneLenclud - 04 Mar 2008

Excellent plug-in! The only thing that's really missing is the ability to collapse blocks of code back into a single line (and collapse/expand for subblocks).

-- AntonLokhmotov - 18 Apr 2008

You can use the TwistyPlugin to collapse the whole code block.

-- PeterThoeny - 19 Apr 2008

Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2008-09-04 - AndrewRJones
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.