[Pmwiki-users] Re: null characters or pattern breaking characters
John Rankin
john.rankin
Mon Jan 12 14:49:03 CST 2004
On Tuesday, 13 January 2004 7:50 AM, Christian Ridderstr?m <chr at home.se> wrote:
On 12 Jan 2004, John Rankin wrote:
> I use the backtick in cases where I want to say "don't do what you
> normally do with what follows".
>
> Specifically:
>
> `WikiWord don't treat this as a wiki word
> `' in smart quotes, make this a right quote
> `- make this an en dash
You're bascially using '`' as an operator... btw, how come you don't use
`-
for – ?
===
My mis-communication. You are correct, `- always produces an en dash.
Sometimes smart quotes will produce one without your having to ask, eg
3-5
automatically becomes
3–5
===
>
> I agree with Christian that this is slighlty different from what he
> wants to accomplish, which is roughly: 'stop here'. As he says, this is
> in effect a zero width space or an invisible comma.
>
> So I suggest `, (backtick comma) as the markup.
>
Using '`,' for ⁣ sounds like a good idea IMO, but not
for the purpose of preventing pattern matches.
...
So... to summarize, I think the token should:
* Be used to prevent pattern matches
* Not produce anything in the HTML output
* Not 'block' future use of other tokens, e.g. ⁣
But inspired from John's suggestion, how about using '`.` as markup for
the token though? The idea would be that it 'reminds' us of the 'STOP' in
telegrams...
===
Christian, this also perhaps offers a better way to solve the : problem
in [[toc:]] markup.
Recap: The code you have been testing to support generation of page
tables of contents has one remaining problem.
When an author writes (the # indicated make an anchor here)
[[toc:]]
:#Term:And its definition follows
:#Another:With another definition
this instructs the script to make a table of contents, picking up Term
and Another. For this to work, it has to guess that a colon not followed
by a space is part of a definition, so text following the colon should be
omitted from the toc entry. This has unwanted side-effects. For example
!!!#An example using the [[toc:]] markup
appears in the table of contents as
An example using the [[toc:
The current fix is to wrap the content in [=...=] markup.
Alternative: A possibly better approach would be to act only on
instruction from the author. Thus (using `. as a stop):
:#Term`.:And its definition follows
:#Another:With another definition
would produce the following table of contents:
Term
Another:With another definition
This allows an author to truncate the table of contents entry for long
headings:
!!!#A long heading`., of which only part displays
It also opens options for making T:WikiWord markup smarter. Inserting a
`. into the first paragraph of WikiWord would cause the script to return
text up to that point.
I would amend your second bullet (Not produce anything in the HTML
output). In the above examples, while this would be true for the text
itself, the references to the text should potentially display as
A long heading... (with a …)
I like the idea of `. meaning stop, and of course . is a full stop :-)
JR
===
/Christian
PS. I hope there's no &InvisiblePeriod; entity...
> > Here's an idea for handling the problem with patterns that swallow too
> > much. Let's introduce a special character/token whose only purpose is to
> > break pattern matches.
> >
> > I've added notes about this here:
> > http://www.pmichaud.com/wiki/Test/NullToken
--
Dr. Christian Ridderstr?m, +46-8-768 39 44 http://www.md.kth.se/~chr
--
Pmwiki-users mailing list
Pmwiki-users at pmichaud.com
http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
More information about the pmwiki-users
mailing list