Skip to content

Conversation

@nmoskaleva
Copy link
Collaborator

Unlabeled code blocks were renderered with doble wrapping.
Example:
Screenshot 2025-12-23 at 09 42 45

@netlify
Copy link

netlify bot commented Dec 23, 2025

Deploy Preview for criipto-docs ready!

Name Link
🔨 Latest commit 62ad27d
🔍 Latest deploy log https://app.netlify.com/projects/criipto-docs/deploys/694a57aa36119e0008434c3a
😎 Deploy Preview https://deploy-preview-263--criipto-docs.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 project configuration.

Unlabeled code blocks were renderered with doble wrapping.
@nmoskaleva nmoskaleva requested a review from fkj December 23, 2025 08:52
Copy link
Collaborator

@fkj fkj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this covers all cases. I scrolled through all the pages and didn't see the problem anywhere in the deploy preview.

I wonder if we can somehow make the tooling warn us about this? I.e. detect the pattern ```\n.

@nmoskaleva nmoskaleva merged commit 494dba3 into master Dec 23, 2025
5 checks passed
@nmoskaleva
Copy link
Collaborator Author

@fkj Good idea, a warning definitely would be nice.

Adding something like

    "*.{md,mdx}": [
      "awk 'BEGIN {in_block=0} /^```/ { if (!in_block && /^```$/) exit 1; in_block = !in_block }'",
      "prettier --write"
    ],

to "lint-staged" seems to work.
(in_block because otherwise the closing ``` will cause an error).

Is this what you had in mind? Or should we use some library instead?

Pardon the "exploratory" approach, I wasn't sure how this is usually done 😊

@fkj
Copy link
Collaborator

fkj commented Dec 23, 2025

@fkj Good idea, a warning definitely would be nice.

Adding something like

    "*.{md,mdx}": [
      "awk 'BEGIN {in_block=0} /^```/ { if (!in_block && /^```$/) exit 1; in_block = !in_block }'",
      "prettier --write"
    ],

to "lint-staged" seems to work. (in_block because otherwise the closing ``` will cause an error).

Is this what you had in mind? Or should we use some library instead?

Pardon the "exploratory" approach, I wasn't sure how this is usually done 😊

@nmoskaleva Yeah that looks good! What does the error message look like for that? Maybe you could do a PR adding it and a intentionally "wrong" commit to show it off.

I don't know if there are any libraries that make it easier, but I think it's fine to use coreutils (i.e. awk) since they should be installed on essentially any platform.

@nmoskaleva
Copy link
Collaborator Author

#264, but it doesn't let the "wrong" file be committed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants