Skip to content

Navigation links break for files containing : #345

@chinatsu

Description

@chinatsu

Context

I'm investigating to see if Zensical can be used as a drop-in replacement for the niri docs. As we also build docs to be displayed on GitHub wiki, we use the relatively often used method of naming files Section:-Blah.md so that they show up as "Section: Blah" on there.

Bug description

Specifying a filename containing a colon (:) in the nav section, such as

nav = [
  { "Get started" = "index.md" },
  { "Markdown in 5min" = "Info:-markdown.md" },
]

leads to navigation URLs like info:-markdown.md.

Trying to specify the colon as : or : does not help, and leads to the same type of bare URL.


The pages get built as expected, so it is possible to navigate to /Info:-markdown manually.

It is also possible to get around this by specifying the nav entry using an URL encoded colon, and omitting the file type, lol.

nav = [
  { "Get started" = "index.md" },
  { "Markdown in 5min" = "Info%3A-markdown" },
]

Related links

Reproduction

repro.zip

Steps to reproduce

From scratch:

  1. zensical new
  2. Rename markdown.md to Info:-markdown.md
  3. zensical serve
  4. Navigate to http://localhost:8000
  5. Observe that the href to "Markdown in 5min" in the navigation is a bare info:-markdown.md

Using repro.zip I guess

  1. unzip repro.zip && cd colonoscopy
  2. uv run zensical serve
  3. Navigate to http://localhost:8000
  4. Observe that the href to "Markdown in 5min" in the navigation is a bare info:-markdown.md

Browser

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions