Re: There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples" - Mailing list pgsql-docs

From Tom Lane
Subject Re: There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples"
Date
Msg-id 1230606.1722900599@sss.pgh.pa.us
Whole thread Raw
In response to There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples"  (PG Doc comments form <noreply@postgresql.org>)
Responses Re: There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples"
List pgsql-docs
PG Doc comments form <noreply@postgresql.org> writes:
> On the page:
> https://www.postgresql.org/docs/16/datatype-net-types.html#DATATYPE-CIDR
> in the "Table 8.22. cidr Type Input Examples" 
> is invalid value for CIDR notation: 2001:4f8:3:ba:​2e0:81ff:fe22:d1f1/128

The value is correct as displayed:

=# select '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128'::cidr;
                 cidr                 
--------------------------------------
 2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128
(1 row)

However, if you try to copy-and-paste it from the web page,
you do indeed get a syntax error, or at least I do using Safari.
The reason is that there's a zero-width space hiding in there:

        <row>
         <entry>2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128</entry>
         <entry>2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128</entry>
         <entry>2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128</entry>
        </row>

and apparently copy-and-paste converts that into something
that cidr_in doesn't like.  It doesn't like regular space
there either, so that's not so surprising.

I believe the &zwsp; got put in there to provide a line-break
opportunity and thus remove overwidth-line warnings in the
PDF docs build.  There are a fair number of other places where
we do the same thing, although perhaps they are less likely
to be something somebody would try to copy-and-paste.

On the whole I'm inclined to do nothing here; these docs have to
satisfy a number of requirements, and "every example should be
copy-and-pasteable" doesn't seem like a good constraint to add.
Another idea perhaps could be to remove enough digits from the
example that it doesn't cause overwidth warnings in the PDF ---
but I'm not sure that's feasible in a 3-column table.  Or we
could just drop this one example.

            regards, tom lane



pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples"
Next
From: "David G. Johnston"
Date:
Subject: Re: There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples"