Tags:
create new tag
view all tags

SID-01932: Can you put quotes in parameterized variables ?

Status: Answered Answered TWiki version: Perl version:
Category: Server OS: Last update: 9 years ago

I've got a parameterized variable for with an include that looks like this:

   * Set NUMCODE = %INCLUDE{ "NoNums" MYCODE = "
   * Set ENDNUMCODE = " }%

which lets me do %NUMCODE% <some code> %ENDNUMCODE% --- and the code that sits between these variables often has quotes.

I've tried changing to .. MYCODE = \"; and MYCODE = $quot ... and MYCODE = ` --- but seems the only thing that works is " or '

Is there any other character you can use to let the content of the variable include double quotes ?

-- Jon Hertzig - 2014-06-09

Discussion and Answer

I first thought you could use a SpreadSheetPlugin CALCULATE to escape double quotes. However, it works only of there are no newlines:

%CALCULATE{$SUBSTITUTE('''aa "bbb" ccc 'ddd' eee''', ", \\\")}%

So you could split up the CALCULATE and embed in NUMCODE and ENDNUMCODE, but this would not be useful because of the single line limitation.

It looks like you are trying to use this to toggle the line numbers in SyntaxHighlightingPlugin. I think it is better to enhance the plugin to do that.

-- Peter Thoeny - 2014-06-09

Cheers,

Yup, relates to my comments on SyntaxHighlightingPluginDev

I'm not a developer, so doubt I'd be able to enhance the plugin myself -- but that sounds like the way to go.

-- Jon Hertzig - 2014-06-09

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Can you put quotes in parameterized variables ?
SupportCategory

TWiki version

Server OS

Web server

Perl version

Browser & version

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2014-06-09 - PeterThoeny
 
  • 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-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.