question about links parsing

cage cage-dev at twistfold.it
Fri Jul 17 17:49:07 BST 2020


On Fri, Jul 17, 2020 at 11:45:28AM -0400, Matthew Graybosch wrote:

Hello!

Thank you for your reply!

> On Fri, 17 Jul 2020 17:25:00 +0200
> cage <cage-dev at twistfold.it> wrote:
>
> > Hi!
> >
> > I have found a page with a link written this way
> >
> > =><whitespace><URL><whitespace><linebreak>
> >
> > that is, a withespace without the link name following.
>
> My understanding of the spec is that the link name is optional. Without
> it, the link would just be a bare URL.
>
> But please don't take that as gospel; I could be wrong. :)

No problem! We are just discussing :)

I think  what you  wrote is  entirely reasonable  (in fact  i actually
modified  my  parser to  act  as  you said)  but  then  i checked  the
documentations and the specs for links is written as:

=>[<whitespace>]<URL>[<whitespace><USER-FRIENDLY LINK NAME>]

So *if*  i understand correctly (and  i am not  sure i did :-D),  if i
interpret the  square brackets  as "optional terms",  i can  read that
line as: "A link is formed by the symbol '=>' followed by any non-zero
number of  consecutive spaces followed by  the url and followed  by an
optional block formed by non zero space *and* a link name.

So if there is a <whitespace> after <URL> a link name *must* follows.

If each  terms after the url  was optional i expect  the specs was
something like:

=>[<whitespace>]<URL>[<whitespace>][<USER-FRIENDLY LINK NAME>]

but like i am just guessing here,  i am not a linguist, just an humble
self taught programmer :)

Bye!
C.


More information about the Gemini mailing list