Skip to content

Commit

Permalink
Fixed #98. Don't count ; at the end of link (when followed with spa…
Browse files Browse the repository at this point in the history
…ce).
  • Loading branch information
tsutsu3 committed Dec 18, 2021
1 parent 68e7bf4 commit f3285e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions linkify_it/ucre.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _re_src_path(opts):
+ SRC_ZCC
+ "|"
+ TEXT_SEPARATORS
+ "|[()[\\]{}.,\"'?!\\-]).|"
+ "|[()[\\]{}.,\"'?!\\-;]).|"
+ "\\[(?:(?!"
+ SRC_ZCC
+ "|\\]).)*\\]|"
Expand Down Expand Up @@ -185,7 +185,10 @@ def _re_src_path(opts):
+ SRC_ZCC
+ "|[.]).|"
+ options
+ "\\,(?!"
+ ",(?!"
+ SRC_ZCC
+ ").|" # allow `,,,` in paths
+ ";(?!"
+ SRC_ZCC
+ ").|" # allow `,,,` in paths
+ "\\!+(?!"
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ http://example.com/123

http://example.com/foo--bar

See http://example.com/123; Example link.
http://example.com/123

http://example.com/123;123

% some sites have links with trailing dashes
http://www.bloomberg.com/news/articles/2015-06-26/from-deutsche-bank-to-siemens-what-s-troubling-germany-inc-

Expand Down

0 comments on commit f3285e2

Please sign in to comment.