New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about Using an extension: Answered

How to implement additional languages to dpSyntaxHighlighter

As described on I create a addtional script shBrushQVS.js and put it into the folder .../pub/System/DpSyntaxHighlighterPlugin/dp.SyntaxHighlighter/scripts.

But whein I try to use this addtional language-script I get an error: DpSyntaxHighlighterPlugin error: The language "qvs" is not supported..

This is my script:

SyntaxHighlighter.brushes.QVS = function()
   var funcs   =   'left peek';
   var keywords =   'from load resident';
   var operators =   'all and any between join not null';
   this.regexList = [
      { regex: /--(.*)$/gm,                  css: 'comments' },         // one line and multiline comments
      { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString,   css: 'string' },         // double quoted strings
      { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString,   css: 'string' },         // single quoted strings
      { regex: new RegExp(this.getKeywords(funcs), 'gmi'),        css: 'color2' },         // functions
      { regex: new RegExp(this.getKeywords(operators), 'gmi'),      css: 'color1' },         // operators and such
      { regex: new RegExp(this.getKeywords(keywords), 'gmi'),      css: 'keyword' }         // keyword
SyntaxHighlighter.brushes.QVS.prototype   = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.QVS.aliases      = ['qvs', 'qv'];

-- RalfKrueger - 12 Nov 2009

You just need to edit lib/Foswiki/Plugins/ and add something like the following around line 86:

/qvs|qv/ and $brush = "Qvs", last;

Then it should work.

-- AndrewJones - 13 Nov 2009

Thanks, it works fine!

-- RalfKrueger - 17 Nov 2009

QuestionForm edit

Subject Using an extension
Extension DpSyntaxHighlighterPlugin
Version Foswiki 1.0.7
Status Answered
Topic revision: r3 - 17 Nov 2009, RalfKrueger - This page was cached on 11 Mar 2018 - 15:06.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License