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

escaped ] not working outside the playground #2201

Closed
nobkd opened this issue Jul 30, 2023 · 9 comments
Closed

escaped ] not working outside the playground #2201

nobkd opened this issue Jul 30, 2023 · 9 comments

Comments

@nobkd
Copy link
Contributor

nobkd commented Jul 30, 2023

Environment

Web

Reproduction

image

https://content.nuxtjs.org/get-started#render-pages

Note
Edit: This seems to work for the published site, since the dependency updates in #2181.

Describe the bug

The escaped ] don't work outside the playground (/ tests)

I even tried it locally on the docs with the latest Docus version v1.14.4 which includes the escape parsing, but it always splits after the first ] even though there is an escape character.
It even displays it. It seems to ignore the rule to match \] before [^\]]

https://github.com/nuxt/content/pull/2169/files#diff-fd60d817a96ebccaa6b1456127b1e4589b3e10487ddb84362ab6e41ab1ede143R23

Maybe there is a missing escape in the regex.

let old = /\[((\\]|[^\]])*)\]/
// use
let new = /\[((\\\]|[^\]])*)\]/

See the extra \ before the first ]
Does not seem to change anything, still, it would be better to escape that properly... (But should also not matter 'cause it's not in a character class)

Perhaps the docs' markdown is read differently than the test and playground one?

Additional context

This is a follow-up to PR #2169

Logs

No response

@Barbapapazes
Copy link
Contributor

The strange part is that playground is correct.

image

@nobkd
Copy link
Contributor Author

nobkd commented Jul 30, 2023

Jep, that's really weird

@nobkd nobkd changed the title escaped ] don't work outside the playground escaped ] not working outside the playground Jul 30, 2023
@nobkd
Copy link
Contributor Author

nobkd commented Jul 31, 2023

Ok... Docus was updated with #2181 and the Nuxt Content Website now displays it correctly...

See https://content.nuxtjs.org/get-started#render-pages
I checked all pages that have ] in code block filenames, and they're all correct...

It didn't work, when I tried updating it locally... 🤷

@nobkd
Copy link
Contributor Author

nobkd commented Jul 31, 2023

If nuxt.com really uses the latest @nuxt/content as mentioned in nuxt/nuxt#22389 (comment), then I don't know where something might be wrong.

Any ideas?

@nobkd
Copy link
Contributor Author

nobkd commented Jul 31, 2023

I updated my local repo to the latest commit (including the dependency updates), and it does still not work locally...

image

Added the <ProseCode> component from /playground/basic/components/content/ProseCode.vue to my local docs folder, as some styles are still broken (they include the ones to display the filename on a code-block...).


What is the difference between the local environment and the one of the published site?
Previously only run in dev mode, but generate & previewing the site does not seem to make the difference...

@Barbapapazes
Copy link
Contributor

I updated my local repo to the latest commit (including the dependency updates), and it does still not work locally...

image

Added the <ProseCode> component from /playground/basic/components/content/ProseCode.vue to my local docs folder, as some styles are still broken (they include the ones to display the filename on a code-block...).

What is the difference between the local environment and the one of the published site? Previously only run in dev mode, but generate & previewing the site does not seem to make the difference...

Have you remove the content cached? In the .nuxt folder?

@nobkd
Copy link
Contributor Author

nobkd commented Jul 31, 2023

Removed .nuxt in docs, didn't change anything.

Edit: Okay... Didn't expect stuff outside the docs/ folder to influence the outcome...
There was an old dist and .nuxt in the root of my project. That probably was the reason.

Thanks ❤️

Works fine now locally, styles loading correctly again, filename is parsed as expected.
Also tried with fresh doc-driven starter and it worked.

@nobkd
Copy link
Contributor Author

nobkd commented Jul 31, 2023

In conclusion, I don't see any reason why this fails for nuxt.com.

All the problems I had were because of:

  • local issues with cached files
  • the Nuxt Content site not running on Docus v1.14.4

and both are now resolved

@nobkd
Copy link
Contributor Author

nobkd commented Aug 2, 2023

Closing this, as it seems to work correctly everywhere (excluding the nuxt.com preview)

@nobkd nobkd closed this as completed Aug 2, 2023
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

No branches or pull requests

2 participants