Skip to content

use as_uri to build the link in AnsiHighlighter - #5196

Merged
pekkaklarck merged 1 commit into
robotframework:masterfrom
d-biehl:use_as_uri_in_ansihighlighter_link
Sep 2, 2024
Merged

pekkaklarck merged 1 commit into
robotframework:masterfrom
d-biehl:use_as_uri_in_ansihighlighter_link

Conversation

@d-biehl

@d-biehl d-biehl commented Aug 31, 2024

Copy link
Copy Markdown
Contributor

In the AnsiHighlighter class, the method for creating file URLs has been improved. Instead of manually constructing the URL via string formatting, Path.as_uri() is now used.

Why Path.as_uri()?

  • Robustness: Ensures correct and OS-independent URL formatting.
  • UNC Paths: Properly handles UNC paths, avoiding common pitfalls.
  • Character Escaping: Automatically escapes special characters to ensure a valid URL.
  • Local Files: Omits unnecessary hostname for local files
  • Error Prevention: Reduces potential errors and inconsistencies in URL construction.

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.

2 participants