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

Markdown absolute links to plaintext files in public directory attempts to link as HTML #4208

Closed
4 tasks done
lifehackerhansol opened this issue Sep 16, 2024 · 1 comment
Closed
4 tasks done
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@lifehackerhansol
Copy link

Describe the bug

If there is a plaintext file in public directory, and the file extension is unrecognized (i.e. .txt files are recognized, but .ini, or any random combination of file extensions, are not), the build system is attempting to convert the links to append .html to it. This causes the link to 404.

Reproduction

NOTE: this reproduces a scenario in the testing environment. docs:build doesn't even run because, as a result of the below generation, the link is being treated as dead.

Add this to /public/hello.ini:

[helloworld]

And then have any page link to it like so:

[download hello.ini](/hello.ini)

And it will generate:

<a href="/hello.ini.html">download hello.ini</a>

Expected behavior

The docs seem to suggest that files in the public directory will be copied as-is to the output directory; the same logic should apply to links. That is to say, there should be no .html suffix in the href and either the download or the browser opening the resulting file in plaintext should proceed.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
    Memory: 4.95 GB / 31.92 GB
  Binaries:
    Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.86)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    vitepress: ^1.3.4 => 1.3.4

Additional context

No response

Validations

@lifehackerhansol lifehackerhansol added the bug: pending triage Maybe a bug, waiting for confirmation label Sep 16, 2024
lifehackerhansol added a commit to lifehackerhansol/Guide_3DS that referenced this issue Sep 16, 2024
lifehackerhansol added a commit to lifehackerhansol/Guide_3DS that referenced this issue Sep 16, 2024
lifehackerhansol added a commit to lifehackerhansol/Guide_3DS that referenced this issue Sep 16, 2024
@brc-dd
Copy link
Member

brc-dd commented Sep 17, 2024

process.env.VITE_EXTRA_EXTENSIONS = 'ini' // additional values should be comma separated without any spaces - `ini,foo,bar`

Put this on top of your .vitepress config file.

#3852 is open about docs.

@brc-dd brc-dd closed this as completed Sep 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants