Skip to content
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

docs: escape ] in code-block filenames #22389

Merged
merged 4 commits into from Aug 3, 2023
Merged

docs: escape ] in code-block filenames #22389

merged 4 commits into from Aug 3, 2023

Conversation

nobkd
Copy link
Contributor

@nobkd nobkd commented Jul 29, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Adds \\ to every code-block filename with ] to escape it. This prevents the filename from being cropped.


Related & Info

See this PR nuxt/content#2169, released in nuxt/content since v2.7.2, to fix this with an escape character

The fix was already shipped in Docus v1.14.4 with nuxt-themes/docus@44aefd5, but it seems, that this version isn't used here currently.
So if this is accepted, before the deps use the latest Docus, the filenames may look like in the following example with an extra \ before cutting off the filename.


Current Example

Here is an example image of how it currently looks, without escaping:

image

The route, where it is from: https://nuxt.com/docs/guide/directory-structure/server#using-a-nested-router

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Jul 29, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nuxt-studio
Copy link

nuxt-studio bot commented Jul 29, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview a9b11dd

@nobkd nobkd changed the title docs: escape [ in code-block filenames docs: escape ] in code-block filenames Jul 29, 2023
@danielroe
Copy link
Member

Checking the live preview, this now doesn't look quite right:

CleanShot 2023-07-30 at 10 39 04@2x

The tricky thing is that the website isn't yet open sourced but atinux is on that.

@danielroe danielroe marked this pull request as draft July 30, 2023 09:39
@nobkd
Copy link
Contributor Author

nobkd commented Jul 30, 2023

As mentioned, this'll look wrong until Docus v1.14.4 is used.

@danielroe
Copy link
Member

Nuxt.com doesn't use docus, and has already updated to the latest Nuxt content version.

@nobkd
Copy link
Contributor Author

nobkd commented Jul 30, 2023

Thanks for clearing that up.
Seems, that there's a different issue in Nuxt Content

@Barbapapazes
Copy link
Contributor

Thanks for clearing that up. Seems, that there's a different issue in Nuxt Content

Ah!

@Barbapapazes
Copy link
Contributor

Barbapapazes commented Jul 30, 2023

In fact, there is the issue even in the content.nuxtjs.org website.

image

It seems that https://github.com/nuxt/content/pull/2169/files is not really correct πŸ˜… (sorry)

@nobkd
Copy link
Contributor Author

nobkd commented Jul 30, 2023

Created an issue nuxt/content#2201

@danielroe
Copy link
Member

Thank you ❀️

@nobkd
Copy link
Contributor Author

nobkd commented Aug 2, 2023

I have no idea, why it shouldn't work with nuxt.com

Since docus was updated in nuxt content, it works there...
And I've also tried a simple project with the latest nuxt content version and the escaping works as expected.

https://stackblitz.com/edit/github-1jd81n?file=content%2Findex.md
(If you're editing and saving index.md on stackblitz, you have to pay attention to the escaping, because it is reduced. Write \\\\ to get \\ on stackblitz)

@danielroe
Copy link
Member

Maybe it's an issue with the preview rather than the code.

@danielroe danielroe marked this pull request as ready for review August 2, 2023 16:10
@Barbapapazes
Copy link
Contributor

it seems ok now!

image

@danielroe danielroe merged commit f7e2b2b into nuxt:main Aug 3, 2023
3 checks passed
@github-actions github-actions bot mentioned this pull request Aug 3, 2023
@nobkd nobkd deleted the docs/allow-]-code-block-filename branch August 3, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants