integrations icon indicating copy to clipboard operation
integrations copied to clipboard

Whitespaces missing after using github integration

Open Utzel opened this issue 1 year ago • 8 comments

When you connect github and edit a file the line breaks don't get carried back up to gitbook again.

How its looking in the original: image

Downloaded code via the github link: image

If you now push the file back up to gitbook the empty lines between the boxes don't get carried over. The spacing in the code before the push were not changed in any way. This sadly also happens for lists, basically rendering the whole github link useless... Website after github push: image

Utzel avatar Dec 18 '24 10:12 Utzel

I think this is expected from the way expandable sections are rendered in the front end - we’re also working on updating the in-app styles to match the published version for this block as well.

Can you try adding this in the whitespace to force the expandables into new lines?  

addisonschultz avatar Dec 18 '24 11:12 addisonschultz

Thanks for the reply :) This sadly also happens for lists ("- ") with a spacing in between, so it goes beyond the expendables.

We tried the   but this results in a space thats bigger than the one we got by using an empty line in the gitbook app...

Image using  : image Image using a line break in gitbook image

Also once you edit the file with   inside they get converted to the tag from gitbook   when you read them back in github. I just find it quite confusing how the exported files generated from gitbook -> github with exactly the same syntax cant be read once committed from github...

Utzel avatar Dec 18 '24 15:12 Utzel

Thanks for pointing this out - basically, it sounds like the conversion of adding   (non breaking space) gets converted to a new markdown line with a space (new line +  )

But it sounds like neither option gives you a space between the expandable blocks 🤔

Can you try adding a h3 tag with empty content ( ) between the expandable blocks to see if that would work as a workaround for now?

addisonschultz avatar Dec 19 '24 06:12 addisonschultz

Yes, that could be the issue with @nbsp;. It also adds an extra whitespace to text lines which offsets them. h3 was till a bit to wide, h6 seems to do the trick, thanks for the help :)

Utzel avatar Dec 19 '24 09:12 Utzel

Okay, sadly h6 also doesn't work for everything... When we want to have a spacing before a list the list gets overwritten and is instead displayed as *...

In this case there's also a link involved but I hope you get the point: image

So I guess there is no real workaround for the spacing issue, which unfortunately renders the github link basically useless... The best case scenario would be for the addon to be able to import the text it exports from gitbook in exactly the same way.

Utzel avatar Dec 19 '24 15:12 Utzel

One last thing to try - if you use the h6 with “content” in it - does it stay?

The content can be a space: “ “.

addisonschultz avatar Dec 20 '24 09:12 addisonschultz

Hey, hope you had a nice Christmas :)

Thanks for the suggestion, we tried it and while the spacing worked correctly it still breaks the formatting of the next line as in the previous post. I suppose this is what you meant?

image image

Utzel avatar Dec 30 '24 09:12 Utzel

@Utzel thank you! Does a simple new line not work in this case (with the unordered list)?

addisonschultz avatar Jan 06 '25 07:01 addisonschultz