Revised 2005 proposal for meta-data

Andrea Censi andrea at censi.org
Sun Dec 31 21:17:33 EST 2006



> > Unfortunately, there is an exception to be done for backward

> > compatibility:

> >

> > [alt text](/url/ "Title with " quotes " inside")

>

> Unless there's a misunderstanding somewhere, this is not an exception

> at all: you MIGHT escape the quotes in the title if you want, it's

> only that you don't really have to.


I was thinking that: in the quotes you MUST escape the ", and you MAY
escape the others.


> A side effect of this is that there's no way to include the string ")

> within a title attribute inside an inline-style link, nor can you add

> some space between the quote and the closing parenthesis to avoid the

> problem.


Exactly.

So, in the interest of clarity, here's the core problem:

If one allows unescaped " in quoted values, this causes ambiguities:

[alt text](/url/ "Title with ") quote and parens inside ")

there are 2 ways to interpret this fragment. Such things should not happen.

Or consider also:

[alt text](/url/ "Title with ") [alt text](/url/ "quote and
parens inside ")

how to interpret this? The grammar is ambiguous.
I don't know much about parsing, but can you actually build a parser
for this grammar? (any CS person out there?)

IMHO it was not a good idea to allow such construct.
The standard pattern in many languages is to allow single and double
quotes, so if you have a title with many single quotes, you use the
double quotes, and viceversa:

"bah 'bah' bah" = "bah \'bah\' bah" = 'bah \'bah\' bah'
'bah "bah" bah' = 'bah \"bah\" bah' = "bah \"bah\" bah"

This should be enough for all needs.

p.s.

Happy new year!

--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi


More information about the Markdown-Discuss mailing list