table escape syntax with escaped FILTERPLUGIN does not work

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

table escape syntax with escaped FILTERPLUGIN does not work

BramVanOosterhout
Hi All,
I am creating a table using the TML vbar syntax. One of the columns contains a
macro. Writing the macro on a single line works fine:
| col1 | %MACRO{ "default" param1="value1" }% |

But when I break the macro and escape the newline the macro fails:
| col1 | %MACRO{ "default" \
param1="value1" }% |

On investigation, the \ is passed into the macro and the parameter list looks
like:
'"default" \\ param1="value1"'
which leads to bizarre results.

I have posted a complete example using FILTERPLUGIN  at
https://foswiki.org/Sandbox/TestTABLEEscape.

It is not a major problem, since it can be easily worked around by not
breaking the lines inside the macro. But it is annoying, since the failure is
completely silent.

I wonder whether this is
   + expected behaviour, or
   + the parameter parsing has an issue, or
   + filterplugin does not deal with escapes.

Thanks for your help.
--
Bram van Oosterhout


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: table escape syntax with escaped FILTERPLUGIN does not work

Julian Levens
Bram

Yes it's bizarre, and I doubt it's expected behavior.

I *suspect* that it's the processing of continuation lines that's
broken, possibly only in new table parsing code (from 2.0 iirc). It'll
need more time to dig into, but it certainly looks like a bug.

I edited your tests topics with some ideas to work around it, but they
were a total dead end and wrong thinking on my part.

I might try again later with new ideas if I get any.

I think you'll need to write a bug report.

Thanks

--
Julian Levens


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: table escape syntax with escaped FILTERPLUGIN

BramVanOosterhout
Hi Julian,
It is sorted (I think)
There is some wrong thinking on my part as well. Your example shows the
solution.

My short description:
| col1 | %MACRO{ "default" param1="value1" }% |
can be broken in the following way:
| col1 | %MACRO{ "default"
param1="value1" }% |

No escape required, as long as %MACRO{...}%
   1 itself expands to a SINGLE line and
   2 is expanded BEFORE the vbar is handled.

I have updated the example in the Sandbox and added a comment.
   1 above I can control and arrange and if need be I can escape new lines in
the macro expansion
   2 above I am unable to judge. I will investigate that further.

Thanks for the prompt response and I'll let the forum know if I find any
MACROs that create trouble in this way.

>
> --
> Julian Levens
>
> ----------------------------------------------------------------------------
--
> Find and fix application performance issues faster with Applications
> Manager Applications Manager provides deep performance insights into
> multiple tiers of your business applications. It resolves
> application problems quickly and reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Foswiki-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/foswiki-discuss


--
Bram van Oosterhout


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: table escape syntax with escaped FILTERPLUGIN does not work

Michael Daum-2
In reply to this post by BramVanOosterhout
On Sunday, May 01, 2016 02:18:13 Bram van Oosterhout wrote:
> But when I break the macro and escape the newline the macro fails:
> | col1 | %MACRO{ "default" \
> param1="value1" }% |

Within a macro white spaces between parameters - including newlines - are not relevant.
It actually is best practice to spread a complex parameter list on several lines with proper indenting applied:

%MACRO{
        "..."
        param1="..."
        param2="..."
        param3="$percentANOTHERMACRO{
                                \"...\"
                                param1=\"...\"
                                param2=\"...\"
                        }$percent"
        param4="..."
}%

It does not matter whether there is table markup around it or not as TML is expanded after
the parser finished processing all macros.

Michael.


--
-- Michael Daum Consulting
-- Wissensmanagement und Intranet-Technologie
-- https://michaeldaumconsulting.com
-- Tel: +49 (0)40 21 99 27 51

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss