Item5953: $params->{_DEFAULT} not robust enough in dealing with '

pencil
Priority: Enhancement
Current State: Confirmed
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: TWiki:Main.SvenDowideit
Waiting For:
Last Change By: CrawfordCurrie
  • SOMENEWTML{hello} works
  • SOMENEWTML{"hello"} works
  • SOMENEWTML{'hello'} doesn't
given the need to use single quotes to insulate from nested double quotes, and that in some places the single quote does function - I'm puzzled by the utility of this.

-- TWiki:Main/SvenDowideit - 24 Aug 2008

I had an argument about this a long time ago. I believe that tag syntax should be context free and robust over a range of quote types. However the existing spec of TML is such that it is neither. By the spec of TML, then SOMENEWTML{'hello'} does work. Just not the way you want it to work.

You can use the context free version of the attrs tag parser, but I think you will meet a lot of resistance to changing the tag syntax in any way. So I'm setting this no-action, as a change to the syntax should go through the feature request process, not the bug process.

-- CrawfordCurrie - 24 Aug 2008

mmm, seems to me to break the principle of least surprise that some tag params work with single quote, and others don't. Setting this to more info required, rather than sweeping it under the table again.

-- TWiki:Main.SvenDowideit - 24 Aug 2008

It will actually break quite a few twiki apps that rely on single quotes to be "freely available", ie. that they don't participate in TML parsing. The easiest way to have parameters in HTML being passed in TML argument position is by using single quotes. So, please, don't change that rule. There's no real need to do it.

-- TWiki:Main.MichaelDaum - 26 Aug 2008

imo, twiki apps rely on single quotes only because TML is so poorly defined wrt quotes. and frustratingly, single quotes are not freely availabe everywhere - some named parameters consider them the same way as double qoutes.

also, the issue you talk about is separate from the one I'm talking about - in that "stuff='asdf'" would still work as it does today, as the parameter is delimited by unescaped double quotes. The bug I raise is that like in Perl, most users initially expect that whatever delimiting character they begin the value part with, should be used - ie main="stuff'qwqw'" should be just as ok as main='stuff"asd"'. naturally, we draw a limit and don't want to go to the extremes as perl regex's.

SOMENEWTML{'hello'} does work - but only for people that have learnt the surprising lesson that these quotes aren't delimiters - I would suggest that most people initially do that, and that the result is not what they expected.

-- SvenDowideit - 12 Nov 2008 - 23:52

The TWiki::Attrs parser has a "friendly" mode that is sensible about the use of quotes. Every so often I turn it on by default, just to see what the impact would be. Depressing. The crappy syntax is so deeply embedded that I don't think we could ever fix this one.

Regrading as 'Enhancement', as it's a major project to rewrite the parser, not a bug.

-- CrawfordCurrie - 13 Nov 2008 - 18:41

ItemTemplate edit

Summary $params->{_DEFAULT} not robust enough in dealing with '
ReportedBy TWiki:Main.SvenDowideit
Codebase
SVN Range TWiki-5.0.0, Mon, 18 Aug 2008, build 17431
AppliesTo Engine
Component
Priority Enhancement
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r7 - 29 Nov 2008, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy