[Pmwiki-users] Re: null characters or pattern breaking characters

Christian Ridderström chr
Wed Jan 14 10:32:00 CST 2004


On Wed, 14 Jan 2004, Patrick R. Michaud wrote:

> At any rate, I've focused on the URI pattern because it's the most
> permissive of the patterns;
Ok, I understand.

> > Hmm... I wonder if I'm "breaking myself" here... would the above 
> > mean that this markup:
> > 	''Here is some italic text [``[include:Main.HomePage]] bla.''
> > is *not* rendered in italics?
> 
> Or, what happens with:
>     ''Is this italic [``[WikiWord]] text '' or is this? ''

syntax error ;-)

> To me, the effects of the null token should be very localized--the
> token should "break" the markup that it's in or next to and nothing more.

I agree.

> In the examples immediately above, the `` would only break the italics 
> sequence if it's in or next to the italics markup characters (the single 
> quotes), and not break the italics markup just because it happens to occur 
> in the middle of the text.

I agree as well, and I'd even say that it should only break the "''", i.e. 
the italics-toggle-token, if it's inside it.
> 
> Here's a somewhat more radical proposal, I haven't thought it all the way 
> through yet but I'll offer it for discussion and see where it leads.  
> What if we defined `` to mean "positively protect the characters
> that follow up to the next space"?  This would allow things like:
> 
>    ``WikiWord                 Displays as "WikiWord" but is not a WikiWord
>    ``[=hello there=]          Displays as "[=hello there=]"
>    ``[[WikiWord hello]]       Displays as "[[WikiWord hello]]"
>    [[WikiWord text w/``]] ]]  Displays as "text w/]] " linked to WikiWord

Why use '``' instead of plain '`', i.e. as in:
	Markup:				Renders as:		Comment
	`WikiWord			WikiWord		No link
	`[=hello world=]		[=hello world=]
	`[[WikiWord hello]]		[[WikiWord hello]]	No link
	[[WikiWord text w/`]] ]]	text w/]]		->WikiWord

But... isn't the problem here "up to the next space"? In the examples 
above... oh, never mind. In "`[=hello world=]", the ` quotes "[=hello" and 
not "[=hello world=]" - guess I'm too used to matching brackets etc.

So, is the suggestion that '`' would basically work like [=...=] do today 
and remove the quoted space-delimited-token before any other substitutions 
occur, and when they are done, the token is put back in?

> In particular, we could then define `` appearing at the end of a line
> to mean "protect the line break", thus offering a replacement for [[<<]]:
> 
>     Yesterday it worked.``
>     Today it is not working.``
>     Windows is like that.``

Hmm... not very intuitive IMHO - although you could probably argue that 
for a non-programmer, this isn't intuitive either:

     Yesterday it worked. \
     Today it is not working. \
     Windows is like that. \

Or is it?  Any non-programmers out there?

> Unfortunately, this definition for `` really isn't a "null token" and
> doesn't provide a way to fix things like @@Meatball:PageName@@, so we'd
> probably still need something to resolve that.

Note: If we use '`' instead of '``', then '``' is "available" as a 
null-token, although it would be more consistent if '``' produced '`'...
(The above is quite funny because of all the '``' and '`')

> Note that 
> || Meatball:PageName|| is likely to be fixed by a change to the URI 
> pattern so I'm not really worried about that case anymore.

Ok.

> They're equivalent.
> 
> > But if so, why is this bad from an implementation point of view... it 
> > wouldn't be that slow would it?
> 
> It's not that it's particularly slow--it's just a bit messier than
> I'd like--i.e., I feel like there's probably a more elegant/powerful 
> solution.

True... it is a bit of a "sledge hammer"...

/Christian


-- 
Dr. Christian Ridderstr?m, +46-8-768 39 44       http://www.md.kth.se/~chr




More information about the pmwiki-users mailing list