Skip to content

Fix and simplify st-urlhandle - #370

Open
jdujava wants to merge 1 commit into
LukeSmithxyz:masterfrom
jdujava:master
Open

Fix and simplify st-urlhandle#370
jdujava wants to merge 1 commit into
LukeSmithxyz:masterfrom
jdujava:master

Conversation

@jdujava

@jdujava jdujava commented May 26, 2025

Copy link
Copy Markdown

Improvements:

  • visually simplified regexes by splitting to url and magnet parts
  • properly capture "www.___" urls
  • slightly more robust line concatenation, which preserves the newlines on empty lines -> before, links at the end of the lines would often become corrupted, now at least empty lines can guard the link
  • fixed removing of the ending punctuation (removing "?" did not work previously)

Improvements:
  - visually simplified regexes by splitting to url and magnet parts
  - properly capture "www.___" urls
  - slightly more robust line concatenation, which preserves
    the newlines on empty lines -> before, links at the end of
      the lines would often become corrupted, now at least empty
      lines can guard the link
  - fixed removing of the ending punctuation
        (removing "?" did not work previously)

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
@2084x

2084x commented Jul 10, 2025

Copy link
Copy Markdown

is it possible to modify the regex to match the full url when quotations or non-english characters are present? eg:

https://www.youtube.com/results?search_query="test"
https://rateyourmusic.com/artist/루나

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