Skip to content

Indentation is sometimes wrong #1201

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

Closed
gaearon opened this issue Sep 26, 2018 · 6 comments · Fixed by #1202
Closed

Indentation is sometimes wrong #1201

gaearon opened this issue Sep 26, 2018 · 6 comments · Fixed by #1202

Comments

@gaearon
Copy link
Member

gaearon commented Sep 26, 2018

Not sure but maybe Gatsby 2 upgrade broke it.

See last <input> on the Forms page:

screen shot 2018-09-26 at 3 24 59 pm

This doesn't seem like an issue with the source. Just something messes up indentation when rendering.

Specifically it seems to happen when there's highlighting on a line.

@Saifadin
Copy link

It seems like the <input /> is not aligned inside the span for the highlighting. If you compare it to the html for the highlighting in the middle part, it seems to be completely off. But looking at the source code it really is just fine.

@tvanantwerp
Copy link

Not sure how Gatsby formats code, but the leading whitespace before the <input /> is inside its own span with class of gatsby-highlight-code-line that is set to display: block. I think the <input /> should be inside of that span, but it isn't. So it's being pushed down by a block element containing only whitespace.

@marcaaron
Copy link

Possibly relevant thread: gatsbyjs/gatsby#8058

@jonsuh
Copy link

jonsuh commented Sep 26, 2018

I noticed this same bug on gatsbyjs.org a couple of weeks ago—looks like it was related to gatsby-remark-prismjs and it was patched: gatsbyjs/gatsby#8058

DSchau added a commit to DSchau/reactjs.org that referenced this issue Sep 26, 2018
Note: I'll work on fixing this in gatsby-remark-prismjs soon, but this
is the fix for now :)

Fixes reactjs#1201
@gaearon
Copy link
Member Author

gaearon commented Sep 26, 2018

Thank you all!

gaearon pushed a commit that referenced this issue Sep 26, 2018
* fix: revert buddy line indenting

Note: I'll work on fixing this in gatsby-remark-prismjs soon, but this
is the fix for now :)

Fixes #1201

* chore: revert version of node removal
@alexandernanberg
Copy link
Contributor

alexandernanberg commented Sep 26, 2018

Edit: All the answers loaded after I commented 😅

Cool that you figured it out! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants