babel / website

:globe_with_meridians: The Babel documentation website
https://babeljs.io/docs/en/index.html
MIT License
749 stars 1.31k forks source link

fix(options): drop visual noise #2908

Closed Armanio closed 1 month ago

Armanio commented 2 months ago

Hi! I notice rubbish on options page. My PR drop unused text.

Снимок экрана 2024-07-09 в 16 53 19
netlify[bot] commented 2 months ago

Deploy Preview for babel-next ready!

Name Link
Latest commit 6fb45be3e57d5cbe53aacb71641072e957eac96e
Latest deploy log https://app.netlify.com/sites/babel-next/deploys/66a7b3027827810008486d04
Deploy Preview https://deploy-preview-2908--babel-next.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 2 months ago

Deploy Preview for babel ready!

Name Link
Latest commit 6fb45be3e57d5cbe53aacb71641072e957eac96e
Latest deploy log https://app.netlify.com/sites/babel/deploys/66a7b302c32c04000903852a
Deploy Preview https://deploy-preview-2908--babel.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

JLHwung commented 2 months ago

Thank you for your PR. Yes the ::: is not meant to be in the final html, but removing it is not better as it is supposed to close the opening :::babel8, a custom markdown directive that we use to build Babel 8 docs website from the same markdown files.

Do you want to take a look at the remark plugin? https://github.com/babel/website/blob/449f038a14f8fbb37d1590f745ed3055bb4dd136/website/docusaurus.config.js#L87-L119

Here we should remove everything inclusively between :::babel8 and ::: when the environment variable BABEL_8_BREAKING is not enabled.

Armanio commented 2 months ago

Thank you for fast response! Sorry for lack of understanding In line 394 opened directive mark :::babel8 and in line 398 directive closed with :::. Look like babel8 directive used correctly but for what that :::? 392

JLHwung commented 2 months ago

Thank you for fast response! Sorry for lack of understanding In line 394 opened directive mark :::babel8 and in line 398 directive closed with :::. Look like babel8 directive used correctly but for what that :::? 392

Good question. I think the ::: 392 is closing the :::babel7 directive in line 368.

Armanio commented 2 months ago

Oh of course! tip directive is children babel7. Okay, what is correct behaviour? Its incorrect mark up or incorrect directive processing and we need support directive inside directive?

JLHwung commented 2 months ago

Oh of course! tip directive is children babel7. Okay, what is correct behaviour? Its incorrect mark up or incorrect directive processing and we need support directive inside directive?

I think we should already support nested directives. I didn't investigate this yet, but my gut is that the remark AST is not correct, it seems like the ::: is not recognized as the end of the :::babel7 directive, but rather a paragraph. You can inspect the remark AST via the root variable.

JLHwung commented 1 month ago

I just pushed the new fix, this is a leftover from https://github.com/babel/website/pull/2848#issue-1988368133. Thanks for reporting this issue.