Subject: Blanks in the first line before the first word in the code boxes

From: Daniel Westermann <[email-masked]>
Date: Fri, 23 Mar 2018 13:56:20 +0100 (CET)

Hi, 

is it only me who sees blanks before the first word in the first line of the code boxes, e.g. here: 

[ https://www.postgresql.org/docs/9.6/static/sql-createtable.html | https://www.postgresql.org/docs/9.6/static/sql-createtable.html ] 
[ https://www.postgresql.org/docs/10/static/sql-createtable.html | https://www.postgresql.org/docs/10/static/sql-createtable.html ] 

For the devel documentation it is fine: 
[ https://www.postgresql.org/docs/devel/static/sql-createtable.html | https://www.postgresql.org/docs/devel/static/sql-createtable.html ] 

Tested in Firefox and Chrome. 

Regards 
Daniel

---

From: Peter Eisentraut <[email-masked]>
Date: Wed, 28 Mar 2018 21:30:00 -0400

On 3/23/18 08:56, Daniel Westermann wrote:
> https://www.postgresql.org/docs/9.6/static/sql-createtable.html
> https://www.postgresql.org/docs/10/static/sql-createtable.html
> 
> https://www.postgresql.org/docs/devel/static/sql-createtable.html
> 

Yeah, that looks weird.  I'll look into it.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

---

From: Peter Eisentraut <[email-masked]>
Date: Wed, 28 Mar 2018 21:32:26 -0400

> Yeah, that looks weird.  I'll look into it.

Just looking at a nearby thread ... something is quite whacky with the
web site stylesheet.  It didn't use to look like this.  Check this out:
https://www.postgresql.org/docs/10/static/pgcrypto.html#id-1.11.7.35.5

---

From: "Jonathan S. Katz" <[email-masked]>
Date: Wed, 28 Mar 2018 21:36:59 -0400

> On Mar 28, 2018, at 9:32 PM, Peter Eisentraut <[email-masked]> wrote:
> 
> https://www.postgresql.org/docs/10/static/pgcrypto.html#id-1.11.7.35.5 <https://www.postgresql.org/docs/10/static/pgcrypto.html#id-1.11.7.35.5>
Something is adding spaces - it’s within the “<pre>” tag, which causes browsers
to interpret each space literally.

For the case of the “digest” function, the outputted HTML shows the first digest
function indented, the second one at the start of the new line.

Jonathan

---

From: Peter Eisentraut <[email-masked]>
Date: Wed, 28 Mar 2018 21:47:38 -0400

On 3/28/18 21:36, Jonathan S. Katz wrote:
> 
>> On Mar 28, 2018, at 9:32 PM, Peter Eisentraut
>> <[email-masked]
>> <mailto:[email-masked]>> wrote:

Yeah, the spaces are in the source, so it's not a CSS issue.  But it
doesn't come out like that if you build the docs locally.  So it's
something in the web site code.

---

From: "Jonathan S. Katz" <[email-masked]>
Date: Wed, 28 Mar 2018 22:02:38 -0400

> On Mar 28, 2018, at 9:47 PM, Peter Eisentraut <[email-masked]> wrote:
> 

If I traced the code correctly, the line I suspect is such:

	s = tidy.parseString(contents.encode('utf-8'), **tidyopts)

I know that the web infrastructure recently updated to the Django 1.11
series, I’m not sure if libtidy or the like were also updated with that. I’ll
defer to Magnus on that.

Jonathan

---

From: Magnus Hagander <[email-masked]>
Date: Thu, 29 Mar 2018 12:14:45 +0200

> series, I’m not sure if libtidy or the like were also updated with that.

This would not change with the change to Django 1.11 -- the actual script
that loads the docs runs outside of Django.

Now, the entire machine was upgraded to a new Debian meaning new python,
new tidy etc some time ago. But this was done the first week of February.

Is it possible that this issue actually showed up around 4-5 February, but
just has gone unnoticed since?

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/>
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

---

From: Tom Lane <[email-masked]>
Date: Thu, 29 Mar 2018 09:40:58 -0400

> just has gone unnoticed since?

It's been there a few weeks, anyway --- I remember somebody complaining
before this particular thread started.  I wouldn't be a bit surprised
if it broke then.

			regards, tom lane

---

From: "David G. Johnston" <[email-masked]>
Date: Thu, 29 Mar 2018 07:01:49 -0700

> before this particular thread started.  I wouldn't be a bit surprised

​First report that both Tom and I responded to, Tom by cc'ing www, was on
the Feb 26th,

https://www.postgresql.org/message-id/151965261562.21248.6807023085541361264%40wrigleys.postgresql.org

David J.

---

From: Magnus Hagander <[email-masked]>
Date: Sun, 1 Apr 2018 17:55:21 +0200

> before this particular thread started.  I wouldn't be a bit surprised

Yeah, it's quite likely that it got broken by the OS upgrade and nobody
picked up on it before then. This can probably be because the backbranch
documentation is only updated when we make actual releases.

However, why does devel work fine when the others are broken. It's the
exact same code that's run to load the docs. The *input* to the loader must
also be different at some point.

---

From: Tom Lane <[email-masked]>
Date: Sun, 01 Apr 2018 12:02:55 -0400

> also be different at some point.

HEAD is the only branch building the docs via XML, so it's hardly
unlikely that the input is different.

			regards, tom lane

---

From: Peter Eisentraut <[email-masked]>
Date: Mon, 2 Apr 2018 11:59:24 -0400

On 4/1/18 11:55, Magnus Hagander wrote:
> exact same code that's run to load the docs. The *input* to the loader
> must also be different at some point.

In devel, the raw HTML output looks like

... <pre class="synopsis">
ALTER FOREIGN TABLE [ IF EXISTS ] [ ONLY ] ...

(with a line break)

but before it looks like

... <pre class="synopsis">ALTER FOREIGN TABLE [ IF EXISTS ] [ ONLY ] ...

(without a line break).

So maybe some part of the processing code thinks it should do some kind
of "indentation" here.

---

From: Magnus Hagander <[email-masked]>
Date: Tue, 3 Apr 2018 15:12:12 +0200

> So maybe some part of the processing code thinks it should do some kind
I think I found the problem, and pushed a fix for it. Basically it turns
off indentation completely on pre-11 versions., I elected to keep indention
on dev because it works there, and it makes debugging any of the formatting
a lot easier.

I've pushed the fix and reloaded the 10 docs. I have not reloaded earlier
branches yet, but I'd be interested in some people reviewing a bunch of
pages in the 10 docs mainly to see if (1) it fixes all the cases, and (2)
it actually breaks some *other* cases.

---

From: Peter Eisentraut <[email-masked]>
Date: Tue, 3 Apr 2018 10:55:04 -0400

On 4/3/18 09:12, Magnus Hagander wrote:
> I've pushed the fix and reloaded the 10 docs. I have not reloaded
> earlier branches yet, but I'd be interested in some people reviewing a
> bunch of pages in the 10 docs mainly to see if (1) it fixes all the
> cases, and (2) it actually breaks some *other* cases. 

It looks correct now.

---

From: "Jonathan S. Katz" <[email-masked]>
Date: Wed, 4 Apr 2018 09:21:32 -0400

> On Apr 3, 2018, at 10:55 AM, Peter Eisentraut <[email-masked]> wrote:
> 

+1

Did a spot check on known broken pages and chose some others at
random. Viewed the 9.6, 10, and devel versions.  10 and devel both
looked correct, and the 9.6 was broken where expected.

The only thing I saw (and this may be something to look at the SGML
source) was some blocks that looked overly indented, but it was consistent
across all versions.  On

https://www.postgresql.org/docs/current/static/queries-with.html <https://www.postgresql.org/docs/current/static/queries-with.html>

If you search for "WITH RECURSIVE search_graph(id, link, data, depth)”
the expression in the CTE is much more indented than similar CTEs above
it.

IMV I would not let this stop us from reloading the earlier versions as that
indentation is consistent across all versions (including 9.6, where it has the
initial indentation as well).

Jonathan

---

From: Magnus Hagander <[email-masked]>
Date: Wed, 4 Apr 2018 22:29:57 +0200

On Wed, Apr 4, 2018 at 3:21 PM, Jonathan S. Katz <[email-masked]>
wrote:

> https://www.postgresql.org/docs/current/static/queries-with.html
>
I've reloaded docs back to 9.3.

---

From: Peter Eisentraut <[email-masked]>
Date: Wed, 4 Apr 2018 20:59:12 -0400

> the expression in the CTE is much more indented than similar CTEs above

This was that way in the source.  Probably originally 8-space tabs.
I've fixed it now.

---

From: "Jonathan S. Katz" <[email-masked]>
Date: Wed, 4 Apr 2018 21:10:06 -0400

> On Apr 4, 2018, at 8:59 PM, Peter Eisentraut <[email-masked]> wrote:
> 

That was my hunch, but wanted to be triple-sure.

> I've fixed it now.

Awesome. Thanks!

Jonathan