Reactjs.org: Indentation is sometimes wrong

Created on 26 Sep 2018  路  6Comments  路  Source: reactjs/reactjs.org

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.

confirmed medium good first issue infra website

All 6 comments

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.

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.

I noticed this same bug on gatsbyjs.org a couple of weeks ago鈥攍ooks like it was related to gatsby-remark-prismjs and it was patched: https://github.com/gatsbyjs/gatsby/issues/8058

Thank you all!

Edit: All the answers loaded after I commented 馃槄

Cool that you figured it out! 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

franciscop-invast picture franciscop-invast  路  6Comments

VinayakBagaria picture VinayakBagaria  路  3Comments

gaearon picture gaearon  路  4Comments

jaredp picture jaredp  路  4Comments

tajo picture tajo  路  4Comments