JSONedit icon indicating copy to clipboard operation
JSONedit copied to clipboard

long json causes stripes to be out of sync with text

Open gonzalobenegas opened this issue 11 years ago • 7 comments

Hi, If I use a long json, as in the following example, stripes get out of sync with the text. Is there an easy way to solve it? Thanks { "Name": "Joe", "Last Name": "Miller", "Address": { "Street": "Neverland 42" }, "Hobbies": [ "doing stuff", "dreaming" ], "Name2": "Joe", "Last Name2": "Miller", "Address2": { "Street": "Neverland 42" }, "Hobbies2": [ "doing stuff", "dreaming" ], "Name3": "Joe", "Last Name3": "Miller", "Address3": { "Street": "Neverland 42" }, "Hobbies3": [ "doing stuff", "dreaming" ], "Name4": "Joe", "Last Name4": "Miller", "Address4": { "Street": "Neverland 42" }, "Hobbies4": [ "doing stuff", "dreaming" ] }

gonzalobenegas avatar May 08 '14 18:05 gonzalobenegas

Works fine for me in Chrome. What exactly do you mean with "stripes get out of sync with the text"?

mb21 avatar May 08 '14 18:05 mb21

screenshot from 2014-05-08 15 39 31

At the bottom, text is no longer centered in the stripe.

gonzalobenegas avatar May 08 '14 18:05 gonzalobenegas

Hm.. it happens only when you zoom in. Will have to look into it..

mb21 avatar May 08 '14 20:05 mb21

This occurs when the line-height of your page conflicts with the default css.

CaptainYarb avatar Aug 16 '14 21:08 CaptainYarb

@blazedd can you send a pull-request with the fixed CSS?

mb21 avatar Aug 18 '14 10:08 mb21

@mb21 From what I can tell it's highly dependent on the CSS your website uses. I'd need to make a CSS rewrite to make it forcefully overwrite site css

CaptainYarb avatar Aug 18 '14 13:08 CaptainYarb

I'm fairly convinced now that this is due to the calculated height of inline elements. Some of the parent elements get 31px high even when I set the line-height to 30px. I was unable to fix this on all zoom-levels since display: inline-block doesn't seem to change that behaviour in Chrome (haven't tested other browsers).

So the only solution I currently see is rewriting the whole CSS to use block-level elements and have them float to the right place.

mb21 avatar Aug 19 '14 11:08 mb21