Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamldoc should not generate p's white only whitespace in it #7352

Closed
vicuna opened this issue Sep 10, 2016 · 3 comments
Closed

ocamldoc should not generate p's white only whitespace in it #7352

vicuna opened this issue Sep 10, 2016 · 3 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Sep 10, 2016

Original bug ID: 7352
Reporter: @dbuenzli
Assigned to: @Octachron
Status: resolved (set by @Octachron on 2017-03-15T22:08:39Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.03.0
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: ocamldoc
Monitored by: @gasche @dbuenzli

Bug description

They sometimes introduce unwanted whitespace in the rendered output and makes it difficult to design a consistent stylesheet (you randomly get either too much whitespace or too little). Using a p:empty rule to hide them is impossible since they do actually have content in it.

Here are a few examples of this.

Before this h2:
http://erratique.ch/tmp/opkg-ocamldoc/var/cache/opkg/ocamldoc/astring/Astring.html#porttrim
Source:
https://github.com/dbuenzli/astring/blob/master/src/astring.mli#L1225

Before this h1:
http://erratique.ch/tmp/opkg-ocamldoc/var/cache/opkg/ocamldoc/astring/Astring.html#port
Source:
https://github.com/dbuenzli/astring/blob/master/src/astring.mli#L1198

Before and after this h1:
http://erratique.ch/tmp/opkg-ocamldoc/var/cache/opkg/ocamldoc/react/React.html#basics
Source:
https://github.com/dbuenzli/react/blob/master/src/react.mli#L821

It seems that it's before header introductions but I wouldn't swear I didn't see this in other places.

@vicuna
Copy link
Author

vicuna commented Sep 10, 2016

Comment author: @dbuenzli

Note that for example this h2

http://erratique.ch/tmp/opkg-ocamldoc/var/cache/opkg/ocamldoc/react/React.html#evsem

has no empty p before. Here's the source:

https://github.com/dbuenzli/react/blob/master/src/react.mli#L772

@vicuna
Copy link
Author

vicuna commented Sep 10, 2016

Comment author: @dbuenzli

Note that in general ocamldoc is really a bit too fiddly with whitespace. It should really follow the simple rules that are present in most ASCII markup languages, which is basically to always generate blocks, those being either separated syntactically by one of its markup language level block or by a blank line.

So for example all the following examples should really only generate a p followed by a pre followed by a p and nothing else.

p1{[pre]}p2

p1
{[pre]}p2

p1{[pre]}
p2

p1

{[pre]}

p2

etc.

@vicuna
Copy link
Author

vicuna commented Mar 15, 2017

Comment author: @Octachron

This should be fixed in 4.06 by #804.

@vicuna vicuna closed this as completed Mar 15, 2017
@vicuna vicuna added this to the 4.05.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants