Re: strange para/programlisting pattern in sgml docs
От | Peter Eisentraut |
---|---|
Тема | Re: strange para/programlisting pattern in sgml docs |
Дата | |
Msg-id | 352b408d-d2f2-4d67-8510-d61f363958b2@eisentraut.org обсуждение исходный текст |
Ответ на | strange para/programlisting pattern in sgml docs (Tomas Vondra <tomas.vondra@enterprisedb.com>) |
Список | pgsql-hackers |
On 25.11.23 21:44, Tomas Vondra wrote: > while working on a patch I noticed we do this in the SGML docs (for > example in indexam.sgml and a bunch of other files): > > <para> > ... some text ... > </para> > > <para> > <programlisting> > some code > </programlisting> > ... description of the code. > </para> > > That is, the program listing is in a paragraph that starts immediately > before it. I just noticed this ends up like this in the HTML: > > <p>... some text ...</p> > > <p></p> > > <pre>some code</pre> > > <p>... description of the code.</p> > > That is, there's an empty <p></p> before <pre>, which seems a bit weird, > but it seems to render fine (at least in Firefox), so maybe it looks > weird but is not a problem in practice ... This is because in HTML you can't have <pre> inside <p> but in DocBook you can have <programlisting> inside <para> (and other similar cases). So the DocBook XSLT stylesheets fix that up by splitting the <p> into separate <p> elements before and after the <pre>. It's just a coincidence that one of them is empty in this case.
В списке pgsql-hackers по дате отправления: