SID-01932: Can you put quotes in parameterized variables ?
Status: |
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
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.