docco icon indicating copy to clipboard operation
docco copied to clipboard

Headers aren't well aligned with code in parallel mode

Open bensleveritt opened this issue 12 years ago • 4 comments

I'm using headers to create sections, but the margins on them makes it look like I'm referring to the 2nd line of the code.

Are we generally discouraged from using headers, or is there some trick I'm missing?

google chrome

bensleveritt avatar Sep 23 '13 14:09 bensleveritt

No, we should be aligning them as best we can. Sometimes the box model can make it tricky, depending on what goes above. Feel free to send a patch if you like.

jashkenas avatar Sep 24 '13 12:09 jashkenas

Ah cool. Will do.

bensleveritt avatar Sep 24 '13 12:09 bensleveritt

+1 just ran into this as well:

balupton experiencing the issue

balupton avatar Oct 08 '13 07:10 balupton

I ran into this a while back. Changing

## Header

to

Header
------

fixed it. Only works for h1 and h2 though, but that was enough for me. There's a difference in how docco parses these syntaxes. Changing

save() if /^(---+|===+)$/.test line

to

save() if /^(---+|===+)$/.test(line) || /^#+\s/.test(line)

makes for more consistent behaviour, but will cause formatting to change for some people.

- Felix

obfusk avatar Oct 17 '13 00:10 obfusk