Skip to content

[201_103] Fix #2324: Normalize URLs in \slink navigation#3058

Open
Prthmsh7 wants to merge 1 commit intoMoganLab:mainfrom
Prthmsh7:201_103
Open

[201_103] Fix #2324: Normalize URLs in \slink navigation#3058
Prthmsh7 wants to merge 1 commit intoMoganLab:mainfrom
Prthmsh7:201_103

Conversation

@Prthmsh7
Copy link
Copy Markdown
Contributor

Fixes #2324

After:

Screen.Recording.2026-03-30.at.1.14.56.PM.mov

What

  • Added runtime URL normalization for \slink
  • Introduced slink-url-normalize and integrated it into go-to-url
  • Reverted earlier markup-layer approach to preserve TeXmacs tree structure

Why

  • URLs without a scheme (e.g., liiistem.cn) were treated as local file paths
  • This caused navigation to fail when using \slink
  • Applying normalization at the markup layer broke link behavior by altering the document structure

How

  • Implemented a heuristic that:
    • Detects missing schemes (://)
    • Identifies domain-like strings (contains .)
    • Skips local paths (/, ~)
  • Applied normalization in the navigation layer before URL resolution

@Prthmsh7
Copy link
Copy Markdown
Contributor Author

@Yuki-Nagori Could you please review this as well when you have a moment? Thanks!

@Yuki-Nagori
Copy link
Copy Markdown
Contributor

The functionality is implemented, but a judgment for whether it is a file needs to be added. Otherwise, if "test.pdf" is entered, it would originally open the file, but now it is being judged as a URL.

image Before image After image

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

Successfully merging this pull request may close these issues.

\slink 不用https,无法正确跳转 liiistem.cn

2 participants