Mara-Li / mkdocs-ezlinked-plugin

Plugin for mkdocs which enables easier linking between pages
MIT License
7 stars 4 forks source link

Correct MD path with unicode characters doesn't render correct HTML path #4

Open ooker777 opened 11 months ago

ooker777 commented 11 months ago

Let's say we have this mkdocs.yml:

site_name: test
plugins:
  - ezlinks:
        wikilinks: true

And this folder structure:

docs/
├── index.md
└── á.md

And in index.md we have this content:

Path has already been encoded: [./%C3%A1%20.md](./%C3%A1%20.md)
Path isn't encoded: [./á.md](./á.md)

The output index.html would be:

Path has already been encoded: <a href="%25C3%25A1%2520.md">./%C3%A1%20.md</a>
Path isn't encoded: <a href="%C3%A1/">./á.md</a>

If the index.md is renamed to something else, says a.md, then a.html would be:

Path has already been encoded: <a href="%25C3%25A1%2520.md">./%C3%A1%20.md</a>
Path isn't encoded: <a href="../%C3%A1/">./á.md</a>

The correct case in any case should be <a href="./%C3%A1/">./%C3%A1/.md</a> or at least <a href="á/">./á.md</a>