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

[Feature request] Optionally allow invalid links in Markdown #1465

Closed
lifehackerhansol opened this issue Jan 16, 2024 · 5 comments
Closed

[Feature request] Optionally allow invalid links in Markdown #1465

lifehackerhansol opened this issue Jan 16, 2024 · 5 comments
Labels

Comments

@lifehackerhansol
Copy link

Clear and concise description of the problem

Crowdin, a widely-known translation platform, has a certain configuration called "In-Context" translating. This essentially embeds a small JavaScript and a set of template strings that consist of string identifiers for Crowdin. You can read more about Crowdin's in-context translation setup here: https://developer.crowdin.com/in-context-localization/

However, when doing it this way, Crowdin generates links like this:

1. crwdns6233:0crwdne6233:0![crwdns6231:0crwdne6231:0](crwdns6229:0crwdne6229:0)

and this breaks compilation:

[vite:load-fallback] Could not load C:/Users/lifehackerhansol/Documents/Git/dsi.cfw.guide/docs/translate/crwdns6229:0crwdne6229:0 (imported by docs/.vuepress/.temp/pages/translate/file-extensions-(windows).html.vue): ENOENT: no such file or directory, open 'C:\Users\lifehackerhansol\Documents\Git\dsi.cfw.guide\docs\translate\crwdns6229:0crwdne6229:0'

You can view an example of a project using this configuration here: https://github.com/cfw-guide/dsi.cfw.guide, where we temporarily worked around it with a hack.

Suggested solution

If possible, it would be nice to disable this open check, ideally for specific files.

I don't know at all if this is possible, as I don't really know enough JS to look around for ideas.

Alternative

No response

Additional context

No response

@lifehackerhansol
Copy link
Author

I also don't really know if it's something that should be done here or done in Vite itself. I assumed the former, as VitePress did it there as well.

@Mister-Hope
Copy link
Member

There is something you should know:

images (and other assets like video and font) setting with local file path needed to be resolved and handled while packing.

In another word, these must be valid:

  • a full file url
  • relative path

These can be invalid as they are kept as is and not being resolved:

  • data uri
  • full url
  • pathname

So in your case, you definitely could write image link with protocol or starting with /, the others like a.jpg will require a local a.jpg.

@Mister-Hope
Copy link
Member

I also don't really know if it's something that should be done here or done in Vite itself. I assumed the former, as VitePress did it there as well.

cc @meteorlxy I think we can support this to avoid broken relative image link stops the build process.

@meteorlxy
Copy link
Member

Ummm... IMO the ignoreDeadLinks of VitePress is not doing the same thing. It's used for skipping VitePress' built-in dead links checking.

@meteorlxy meteorlxy added the discussion Discussion label Jan 24, 2024
@github-actions github-actions bot added the stale label Feb 9, 2024
Copy link

github-actions bot commented Feb 9, 2024

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 7 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants