Skip to content

Commit

Permalink
remove trailing periods and commas from clicked uri
Browse files Browse the repository at this point in the history
  • Loading branch information
iTakeshi committed Jan 3, 2023
1 parent fd07769 commit 41de504
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ static bool on_vte_click(VteTerminal* vte, GdkEventButton* event, void* user_dat
return false;
}
if (uri) {
for (int i = strlen(uri) - 1; uri[i] == '.' || uri[i] == ','; i--) {
uri[i] = '\0';
}
context_launch_uri(context, uri);
return true;
}
Expand Down
3 changes: 0 additions & 3 deletions src/regex_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,5 @@ void test_regex()
// NOT match
g_assert(check_match(0 , URI , "foo:" , NULL , 1)); // only scheme-like part

// TODO https://github.com/endaaman/tym/issues/46
// assert(check_match(0, URI, "link to https://example.com." , "https://example.com" , 0));

printf("regex tests complete!\n");
}

0 comments on commit 41de504

Please sign in to comment.